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 the News & Announcements to learn more.
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.