Hello,
I wanting to schedule a flow to run every week and if the expired date in a document library is greater than the current date, then create a planner entry so the employee can update the document. Is this possible and how?
I can see you can schedule a flow but i cant see how to then relate that flow a field in a document library.
Thanks
Solved! Go to Solution.
Hi resolver101757,
Please consider to use the action “SharePoint-Get files(Properties only)”, then add a Condition after the action to filter the dates that are greater than current date.
At here, workflow definition language will work for you. Please check more details function at here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
Following screenshot is the flow I created on my side.
Please make sure you have added a Date column in the library.
About the Condition, in basic mode, select the date column from the dynamic content, then click “Edit in advanced mode”, configure the code with greater function.
Besides, you also need to format the current date to the same format with the date column in your library. So please consider to use formatDateTime function.
Please try it on your side and feel free reply if you need more help.
Best regards,
Mabel Mao
Hi resolver101757,
Please consider to use the action “SharePoint-Get files(Properties only)”, then add a Condition after the action to filter the dates that are greater than current date.
At here, workflow definition language will work for you. Please check more details function at here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
Following screenshot is the flow I created on my side.
Please make sure you have added a Date column in the library.
About the Condition, in basic mode, select the date column from the dynamic content, then click “Edit in advanced mode”, configure the code with greater function.
Besides, you also need to format the current date to the same format with the date column in your library. So please consider to use formatDateTime function.
Please try it on your side and feel free reply if you need more help.
Best regards,
Mabel Mao
Hello
How do you prevent error if the date is null ?
Thanks
You can convert NULL into a default value by applying a "coalesce" based expression
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
Hope this helps
Proud to be a Flownaut!
@efialttesThank you for the tip 🙂
In my "apply to each", I have changed the condition and added the coalesce (condition that falled in error when the date was empty):
@lessOrEquals(formatDateTime(coalesce(items('Apply_to_each')?['Launch_x0020_Date'], '2000-01-01T00:01:00Z'), 'dd/MM/yyyy'), formatDateTime(utcNow(), 'dd/MM/yyyy'))
No more error, but it seems that it returns always the '2000-01-01T00:01:00Z' and thus do not evaluate the condition with the "Launch Date" value
What am I doing wrong ?
Can you inspect the content of items('Apply_to_each')?['Launch_x0020_Date'] ?
You can do so, for example, by adding a Compose action block just before the condition evaluation and assigning
items('Apply_to_each')?['Launch_x0020_Date'] as an expression.
Once you save the flow, execute it. Then go to the FLow's Run History, click on the last iteration executed and verify the value assigned to the Compose action Block in each iteration of the Apply to each
Please note I have never used the expression items('Apply_to_each') yet; I tend to implement item() instead.
Hope this helps
Proud to be a Flownaut!
@efialttesThanks. It works now.
I used an incorrect internal label
@M_DONNAYThank you for sharing!
Proud to be a Flownaut!
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
45 | |
44 | |
37 | |
33 | |
27 |
User | Count |
---|---|
48 | |
37 | |
32 | |
32 | |
29 |