Hi everyone,
I’m trying to build a Power Automate flow that will generate a CSV file containing all items from a SharePoint list along with their full version history.
The requirements are:
1. The Site URL and List Name must come from the trigger inputs, so the same flow can be reused for multiple SharePoint lists.
- Example: I want to manually trigger the flow and enter Site URL + List Name once, and the flow should run using those values.
2. The flow should generate a CSV that includes:
- All list item fields
- All version history records for each item
- Version fields like VersionLabel, Modified, ModifiedBy/Editor, etc.
3. The CSV columns need to be dynamic, because each SharePoint list may have different columns.
- I can't hardcode column names since the flow should work with any list.
4. I’ve tried calling the REST API endpoint:
/_api/web/lists/getbytitle('LISTNAME')/items(ID)/versions
but constructing the URL dynamically and extracting user fields like “Modified By” has been tricky.
Does anyone have a sample flow, pattern, or best approach for:
dynamically getting all fields for each item
looping through each item’s version history
building a CSV dynamically
supporting any SharePoint list through trigger inputs
Any help, examples, or guidance would be greatly appreciated. Thank you!
P.S. I've already created a working flow from a sample SharePoint List, but my problem is the columns are hardcoded. I want it to be dynamic so I can use for other SharePoint Lists.