As you can see in the picture below, initally, I am using the trigger 'When file is created or modified (properties only)". I need a condition to tell whether a file is being created up merely updated. If it is new, then it will use the 'Yes' section and create a new item. If a file is just being modified, then it will update the list item. But, I do not know how to set up the condition to do this?
Yes, it can be achieved by using a Condition to check if the Created time and Modified time are equal.
If they are equal, then the file is new. While if they are not equal, then the file is being modified.
From the screenshot, it seems that you are trying to create/update item in a SharePoint List. When using the “Update item” action, you will be asked to specify the Id for the item.
To get the Id field, you could consider using the action “Get items”, then adding a Condition to filter the one that is required.
Please take the following screenshot for a reference.
If you need more help, please feel free reply.
I've found that this is not always accurate (although I'm not sure why). I have records with only 1 version where the created and modified time stamps differ by several milliseconds. I've had to modify my flow to check if they're within a few seconds of one another, which doesn't feel like a great solution. Would love something more iron clad.
I ended up changing my flow so that I look at the version of the item. If it is 1.0, then it's new...otherwise it's being modified. Versioning must be enabled for this to work.
I am trying your suggestion. But, The condition in my Flow does not have 'Edit in Advanced Mode' . I wonder if it is because the site is on SharePoint online 2013 but not SharePoint online 2016. I am stuck in the last step.
I really hope to see that your suggestion works for me. Thanks.
Testing with different tenant sharepoint site - I believe this is in SharePoint 2016 - 'Condition' has 'Edit in advanced mode'. But, when I tried to save the flow.
Got error: The template validation failed: 'The action(s) 'SPRest-Verison' referenced by 'inputs' in action 'Initialize_variable' are not defined in the template.'.
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
Many congratulations to the Season 1 2021 Flownaut Crew!
ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.