How can i pass the object list of the data grid 2s datasource to other microflows

Hi, Mendix folks! Currently, Im trying to insert a row below the selected row in mendix. I tried it by using index. But when using index, I can't use sort function.  Instead of using index, I'd like to use list operation. How can i achieve it? 
1 answers

What if you try the following scenario.

Your entity has an index/sort attribute.

Use a microflow as datasource for you DataGrid2 list. In the microflow you will return a list of entity objects sorted by index.

In a custom content column you add a 'add row below' microflow button.

Parameter is the selected row. In the microflow, you will create a new object with an index that is one higher than the parameter's index. Next you will need to retrieve (from DB) all the objects with an index higher than the parameter's index and iterate over that list to increase the index by one (Double check if the newly created object is not in the list).

You will then save the new object and the updated list and refresh the client to trigger the datasource microflow to run again.

The exact scenario of course depends on your requirements and the kind of list you need to display, but hope this will give you some ideas on how to solve your issue.