“I’d like to use the Power Automate action ‘Get changes for an item or a file’ to return all changes since a date, but all I get is error: ‘Invalid format for version input value’.”
The ‘Get changes for an item or a file (properties only)’ action will give you information if a column was updated. You can take changes in the last update, changes between multiple versions, or changes based on a date. The date value is useful if a SharePoint item is updated multiple times a day, or if users edit the item in the display form. In both situations you’ll have multiple item versions during a day, maybe too many to process them one by one. And if there’s a flow connected to those updates, it might be better to run it only once and process all those changes.
The problem is that if you use a date in the ‘Get changes…’ action, you’ll probably end with an error: Bad request. Invalid format for version input value.
The action doesn’t like the date format.
Format the date in the right format
If this long date and time is not what the action wants, how do you find the right format? Don’t rely on the description, it’s wrong. If you use the recommended format, it’ll fail again.
The best way to find the format is to run the action with an input that works, and then check what it looks like. Let’s use the ‘Modified’ date.
Run the flow and check the flow run history. If the action was successful, then the format must be correct.
That date and time format corresponds to the one below:
year-month-dayThours:minutes:secondsZ
yyyy-MM-ddTHH:mm:ssZ
That’s the format to use for your custom date, e.g. to get all updated columns since the start of the day with the startOfDay(…) expression. It’s a similar expression to the startOfMonth(…), but this one will return start of a day.
startOfDay(utcNow())
Add the desired format:
startOfDay(utcNow(),'yyyy-MM-ddTHH:mm:ssZ')
And use it in the ‘Get changes…’ action to get all today’s changes.
Summary
If you want to get all changes since a specific date, you must use the format Power Automate wants. In this situation is the action description a bit misleading, but a successful run isn’t. Try to use one of the available dynamic contents, and if the flow runs fine, that’s the format you need. Then just replicate that format for your date.
The solution above described how to get today’s changes, but you can take changes since any date. You just need to use the same format. Once you have the column information, you can extend the flow to take only the updated ones and extract their old and new values.
Hi Tom – your blog is extremely helpful, especially for a beginner like me – thank you for spending your time to document these solutions!
I want to summarize all the modifications to a list item once a day rather than send an email each time the item is modified. Is it ok to use the “when an existing item is modified” trigger to accomplish this, or do I need to use a scheduled cloud flow that runs once a day instead? I plan to use this blog’s startOfDay(utcNow(),’yyyy-MM-ddTHH:mm:ssZ’) expression.
I successfully created the rest of the flow using your other great articles.
Hello Erica,
if you want an email once a day then it has to be a scheduled flow – that’s the only way how to guarantee that it’ll run only once. The ‘When an existing item is modified’ trigger would start a flow with every change.