Count of rows in a data grid

I have a data grid displaying a list of numbered questions. When adding a new question, I would like to automatically set the number field to one more than the count of existing questions. To do this I need some function to return the count of rows in the data grid. I could use a microflow to pass the List of questions, then step through each one incrementing a counter, but there must be a better way. Has anyone done this?
1 answers

when you have a list of objects you do not need to step through and increment a count just use the microflow action 'aggregate list' then choose action-> funtion->count