cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Reoccurance to send email if completion date + set period is less than current date does not work

Hi all,

 

Looking for a little help for building my flow, for our process we need users to add post completion comments after an action has been completed.

 

The original actionee picks the review period for the action (1,2,3 or 6 months). When the action is set to complete a flow adds todays date to the completion date field. The flow should run every day and if the post completion review is not filled and the action is complete and the current date is more than the completion day + review period then it should send an email to the actionee to get them to fill in the post completion review.

 

9am recurrance, initialise the days to add variable9am recurrance, initialise the days to add variablecheck completion date is entered, check post completion is nullcheck completion date is entered, check post completion is nullswitch on period seems to be broken and potentially formula to create dates?switch on period seems to be broken and potentially formula to create dates?err.png

 

Is the addDays part correct?

 

Why does the period switch fail? if i have apostrphes around 0, 1 then the flow complets but 1 does not = '1' so the days to add is never added

3 REPLIES 3
Highlighted
Advocate I
Advocate I

Re: Reoccurance to send email if completion date + set period is less than current date does not wor

I have changed my review period to the format "30 days", "60 days" ect rather than "1", "2" as the switch didn't seem to work correctly with pure numbers - now the flow actually goes down the right route.

 

I have found that the Compose function does not do what I expected -Compose does not return the result of the functionCompose does not return the result of the function

instead it just gives me the text and adds in my variables, but at least I know the variables have the right information! (date and 30 days)

 

I have now made this compose function only the CompletionDate - I do not understand why i need to compose this in order to use the CompletionDate later on, but hey it works.

 

and then in my next condition i compare to the add days function:

addDays(outputs('completion'), variables('daysToAdd'))

image.png

 

And I have changed my "Increment variables" back to "Set variable"

 

Now It seems to be working I will keep an eye on it.

Highlighted
Community Support
Community Support

Re: Reoccurance to send email if completion date + set period is less than current date does not wor

Hi @Zango,

 

Has your problem been solved?

The formula filled in Compose should be written in Expression and then applied to Inputs instead of writing formulas directly in Inputs.

And you need to use items(‘Apply_to_each’)[‘Column name’] to traverse the value of this column.

Like:

formatDateTime(addDays(items('Apply_to_each')['CompletionDate'],variables('daysToAdd')),'dd-MM-yyyy')

29.PNG

 

Correct result:

30.PNG

If you still have problems, feel free post back.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Administrator
Administrator

Re: Reoccurance to send email if completion date + set period is less than current date does not wor

Hey, @Zango!

Thank you for posting on the Flow Community Forum! It appears as though @v-bacao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (8,720)