0

I have a SharePoint Library (modern) in which there are numerous files already uploaded, and more get uploaded every few days. I have a "Reminder Days" column (Date) that I'd like to add 30 days to a Published Date Column that the User enters after uploading a new Document/File.

When I initially tried out a flow with Update File Properties to perform this task. My logic worked, but it applied to every File in the Library.

It triggers when a file created or modified. Is there a way I can set a Flow to Update the Reminder Days column ONLY in the newly uploaded File, and not create an infinite loop?

2 Answers 2

1

Recommended solution:

If you want to run the flow and update date column only when a new file is created, you should use When a file is created (properties only) trigger in Power automate flow.


If you want to continue using "When a file is created or modified (properties only)" trigger for any other reasons, you can use trigger conditions like:

@and(equals(triggerBody()['Created'],triggerBody()['Modified']),equals(triggerBody()?['ReminderDays'],null))
  1. Use correct internal name for your Reminder Days column in above expression. Follow this to get internal name of your column: How to find the Internal name of columns in SharePoint Online?
  2. Check my answer on this thread to check where to add trigger condition: Power Automate Create record based on filter criteria
1
  • You can't use "When a file is created", because of this fact: "to add 30 days to a Published Date Column that the User enters after uploading a new Document/File". It triggers when the user uploads the file, not when edit the properties (because it's already uploaded before). Commented Dec 27, 2022 at 7:06
0

You will want to create a Trigger Condition to your flow.

As a starting point, using this trigger condition, your flow would only run any time the document is modified on the day it was created (it compares date created to date modified and only runs if they match)

@equals(formatDateTime(triggerBody()?['Created'],'dd-MM-yyyy'),formatDateTime(triggerBody()?['Modified'],'dd-MM-yyyy'))

You could definitely improve on this, perhaps adding another condition that will only allow it to run if the 'Reminder Days' field is empty.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.