Forum Discussion
quickeyes9
Oct 21, 2024Copper Contributor
Sharepoint custom lis view sorting
Hello I am trying to figure out how sharepoint saves the order of a custom list view and how it can be extracted possibly ? Particularly when using drag and drop feature. I need to extract with power automate in order to custom sort how I grab the items from the custom view , any ideas??
1 Reply
Sort By
How about by leveraging Power Automate:
-
Create a Custom Column for Sorting:
- Add a new column to your SharePoint list, such as “SortOrder” (Number type).
- Manually update this column to reflect the order you want. For example, assign numbers 1, 2, 3, etc., based on the desired order.
-
Update the Sort Order Using Power Automate:
- Create a Power Automate flow to update the “SortOrder” column based on your drag-and-drop actions. This might involve using a combination of triggers and actions to capture the new order and update the column accordingly.
-
Sort Items in Power Automate:
- Use the “Get items” action in Power Automate to retrieve items from your SharePoint list.
- Apply an OData filter query to sort the items based on the “SortOrder” column. For example:
_api/web/lists/getbytitle('YourListName')/items?$orderby=SortOrder asc
-
Custom Sorting in Power Automate:
- Once you have the items sorted by the “SortOrder” column, you can process them in the desired order within your flow.
Here’s a basic outline of how you can set up the flow:
- Trigger: When an item is created or modified in the SharePoint list.
- Action: Get items from the SharePoint list.
- Action: Apply to each item - update the “SortOrder” column based on the new order.
- Action: Use the sorted items for further processing.
-