Datagrid 2 - sorting throught Microflow doesnt work

0
Hello,   I want to switch the position of a row through a button click, which is in the same row. My Microflow is changing the Row ID of the selected Row, aswell as the Row ID of the Row above or below the selected row, depending if I want to move the selected Row up or down. In my Microflow, I change the Row ID, and then I sort the List of Data. During debugging, i can see that at first it looks like this: 1,3, 2, 4  → then after sorting List of an attribute (here “Row ID”) like this: 1, 2, 3, 4. But in the datagrid2 after commit and refresh in client it still shows me this: 1, 3, 2, 4.   Why wont it work?
asked
2 answers
0

 

I would suggest you to disable sorting in the datagrid (uncheck Sortable for that column), and sort the list while retrieving from db in the microflow (ORDER BY RowID ASC).

This way datagrid will always show the list sorted by RowID

 

To dynamically change the RowID of selected Rows and refresh on the screen, place a parent dataview object with a boolean Refresh attribute.

Whenever user click the button, you microflow can change the RowIDs of the related rows and commit them (without refresh) and at the last step of the microflow just toggle the Parent object's Refresh attribute. this way, datagrid will refresh itself automatically and you will have the list with new RowIDs as you wished.

answered
0

Hi Shahbaz  and Sujata,

 

Out of curiosity, I tried to replicate this scenario. If I understood correctly, you want to move rows up/down with an inline button.

In that case, you just need to swap the RowID values of the selected row and the impacted up/down row, commit both objects, and refresh them.

Then in Data Grid 2, make sure the datasource is sorted by RowID ASC.

That's all :)

 

for your reference  what i did was -  to use one microflow for up/down sequence -  I sent selected rowId - 1 in case of moving up, selected rowId + 1 in case of moving down. then in microflow retrieve the NewRowID object and swapted the rowIds. 

 

image.png

 

image.png

 

At datagrid 2 : 

image.png

 

Hope this helps !! 

lemme know if i missed anything 

 

answered