I have created a flow that checks dates in a sharepoint list to the current date and if the date is a match at starts an approval to send a follow up email.
The flow runs every morning at 9am and i have got it all working perfect. The only issue i have is that if the flow runs on a weekend when no one can approve the follow up until a monday morning the first approval get approved on the monday morning but the next item in the list gets missed because the condition checks the date against the new monday date.
I therefore need the date to on the expression to be static.
If anyone could help it would be greatly appreciated.
Here is my flow and the axpression im using is
Can you tell me how the 1st Follow-up date is set? You might consider leaving your Flow unchanged and setting the first follow-up date to the following Monday. The DayOfWeek() and AddDays() expressions will be very helpful to you should you want to set this date via a Flow.
As an aside, you may want to using an OData filter in your Get items expression rather than using a condition. Using the filter will mean that only items with a 1st follow up date of today will be returned. Your Flow will run faster and using the filter will help you avoid the limits of how many items can be retrieved from a SharePoint list.
OData filters use a columns internal name. If your column name is 1 Follow Up then the OData filter (filter query) will look something like this:
_x0031_st_x0020_Follow_x0020_Up eq 'expression'
The expression will be the same: formatDateTime(utcNow(), 'yyyy-MM-dd')
If you need additional help. please post here.
@Barber_Chris in addition to what @ScottShearer said within that OData you can build a more complex condition using the functions @ScottShearer referenced. Also, don't bother executing the Get Items if CurrentDate is Saturday or Sunday.
Here's some psuedo code for you for the Get Items filter:
YourDate eq CurrentDate
dayOfWeek(CurrentDate) eq 1 (Monday)
YourDate eq addDays(CurrentDate, -2) --Saturday
YourDate eq addDays(CurrentDate, -1) --Sunday
Best of luck to you,
The first follow up date is in a sharepoint list colum. There is a few hundered items in the list and this grows weekly as there are all quote's we have sent to clients.
The OData filter sounds great but im relatively new to flow with limited programing knowledge so im not sure how easy this would be for me. Do you have any further info on how i would set this up?
After looking at your Flow again, I just realized that you have another issue that will require you to re-write your Flow. The issue is that with a standard approval, the Flow pauses until the approval is complete. You have your approval inside of a loop. Therefore, the Flow will pause on each approval until it is complete before it sends the next approval.
There are a number of ways to work around this issue. Before I propose a solution, can you tell me how the 1st follow-up date is calculated? Is it based on when the item is created? How far from the created date is the first follow-up date?
Thanks for the follow-up.
I believe that your solution is going to involve using the new "Create and Approval(V2)" action. This action does not wait for action to be taken on an approval before moving on. You'll need to loop through each approval that was started after the approval actions loop in order to take action when the items are approved or rejected. The Flow design needs some thought.
Also, can you tell me why you don't run the Flow every day? That way, nothing will be missed and you won't need to complicate the Flow with logic to account for weekends.
Ok can i just change the "start an approval" to "Create an Approval (V2)"?
The flow does run everyday at 9am. but on a weekend there is no one to approve the flow so it sits there all weekend until monday morning and then the date has changed and no longer matched the ones which needed to run on a saturday and sunday date.
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!