How to set the order number dynamically for changing list objects

0
HI experts, My requirement: I have to retrive multiple list object and have to give them the order number. These list items can be brought up and down s accordingly the  order number for that object has to store.   For example: There are 3 list object initilly. L1, l2 and l3   L1      1 L2      2 L3      3   I have moved L1 below L2 so initially the order number of L1 was 1 but since I have moved L1 below so the order number for L1 ha become 2 and L2 has become 1.   What has been done till now: I am able to move the list up and down but unable to set the order number.   Please help me in details how to achieve this. Do let me know if anyore information is needed    
asked
2 answers
0

Hi Harsh,

     To manage the ordering, consider using an Integer attribute for the order number and a String attribute for the item name.

     When retrieving the list, apply sorting based on the OrderNumber to ensure correct display in a List View or Data Grid.

For moving an item up or down:

  • In the button’s OnClick microflow, pass the selected item as a parameter.
  • Adjust the OrderNumber (-1 for moving up, +1 for moving down`).
  • Commit the updated object and refresh the list to reflect the changes.

Example:

Before Moving Up:

L1 → 1

L2 → 2

L3 → 3

After Moving Up (L2 moves up):

L2 → 1

L1 → 2

L3 → 3

Let me know if you need further details.

 

Best Regards,

Guna P

answered
0

I think you need "Read/Write" access rights for the attribute OrderNumber for the applicable role.

After that Sort the list on OrderNumber.

answered