web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Building a recurrance ...
Power Automate
Unanswered

Building a recurrance - test suceeds but branching does not send email???

(0) ShareShare
ReportReport
Posted on by 91

Hi,

 

I am trying to create a flow based on 3 days before a date, but won't work. Assistance would be appreciated, please 🙂

RezzaB_4-1690772617569.png

 

 

 

RezzaB_2-1690772509830.png

 

 

Cheers,

Renee

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    You should be using the Compose action in a filter query of your Get Items action so it only returns items that meet your criteria.

     

    The way you have it set up right now is that it's currently looping through every item returned from the Get Items action. Since you are only sending an email for items that meet your criteria. It's best to filter out those items first.

     

    You also need to adjust the expression in the compose action. The formatDateTime() function isn't required as you are able to format the date/time with the addDays() function.

     

    When you use dates in the Get Items action, it has to be in this format 'yyyy-MM-dd'. 

     

     

    addDays(utcNow(),3,'yyyy-MM-dd')

     

     

     

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉Watch my tutorials on YouTube
    👉Tips and Tricks on TikTok

     

  • RezzaB Profile Picture
    91 on at

    Hi @v-jefferni 

     

    Thank you for your answers. 

     

    I have not added anything in the filter query.

     

    There are dates in the birthday column, the one hilighted in 3 days time is my test one 

    RezzaB_0-1690773909318.png

     

     

    Also, when writing the body email the dynamic content does not list Birthday, but does when click the subject line. why would that be?

     

    Fustrating thing is I had this flow working last week and then changed the list and then didnt work.

     

    Cheers,

    Renee

  • v-jefferni Profile Picture
    on at

    Hi @RezzaB ,

     

    Sorry, I misunderstood the situation of this case. Since it's a date value including year, you cannot compare the column values with a MM-dd value. Please try and modify the Birthday in the loop to be following:

    formatDateTime(items('Apply_to_each')?['Birthday'], 'MM-dd')

     

    Best regards,

  • RezzaB Profile Picture
    91 on at

    Hi @v-jefferni 

    Do you mean to add that expression in compose?

    RezzaB_0-1690775255032.png

     

    Cheers,

    Renee

  • v-jefferni Profile Picture
    on at

    Hi @RezzaB ,

     

    No, I mean write this expression in Condition control, replacing the original Birthday in the left side.

     

    BR,

  • RezzaB Profile Picture
    91 on at

    Thanks @v-jefferni  but didn't work

    RezzaB_1-1690780326532.png

    RezzaB_3-1690780372914.png

     

    RezzaB_0-1690780242336.png

     

  • v-jefferni Profile Picture
    on at

    Hi @RezzaB ,

     

    I believe there should be blank in the Birthday column of the list. Please change the expression as follows:

    if(empty(items('Apply_to_each')?['Birthday']),'',formatDateTime(items('Apply_to_each')?['Birthday'],'MM-dd'))

     

    BR,

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @RezzaB  I would recommend adjusting your flow a bit.

     

    Compose - 3 Day Date

    As mentioned in my previous post, you don't need the formatDateTime() function.

    addDays(utcNow(),3,'MM-dd')

     

    Get Items

    Add a filter query to ensure you are only returning items that have a value in the Birthdate column. My column name is Birthdate, adjust that text to match your birthday column's internal name. 

    Birthdate ne null

     

    Filter Array

    As I mentioned in my previous post, looping through all items returned from the Get Items action and checking to see if the date is a match is not efficient. It would be more efficient to filter out the values returned that meet your criteria.

     

    In this case, you need to filter out values returned from the Get Items action to see if the Birthdate date contains the 'MM-dd' from the Compose - 3 Day Date action. 

     

    creativeopinion_0-1690780638064.png

     

    Compose - Filter Array Count (optional)
    This is an optional action. I like to add a Compose action to count the number of items returned in a Filter Array action in my flows. It helps with troubleshooting. When you run the flow to test it, this Compose action will display the number of items returned.

    length([filter array body output here])

    creativeopinion_3-1690781226099.png

     

    Run a test at this point so you can view the outputs which you will need for the next step. 

    In the Filter Array output, the text in red is what you'll need for your Send an Email (V2) action. 

    creativeopinion_1-1690781007784.png

    Apply to Each

    Insert the Body dynamic content from the Filter Array action instead of the Value dynamic content from the Get Items action.

     

    This way you are only looping through the Filtered Items.

    creativeopinion_5-1690781424967.png

     

     

    Compose Action(s) – Optional

    I would recommend using Compose actions to return the values that you will be using in the Send an Email (V2) action. Even before adding the Send an Email (V2) action, add Compose actions to return all the values you need from your Filter Array action.

     

    With the Filter Array action the only dynamic content available to select is the Body which is why you will need to use expressions to access the content returned.

     

    To return the birthdate of my item I used this expression:

    item()?['Birthdate']

     

    creativeopinion_4-1690781394986.png

    You will need to reference the outputs from the Filter Array action and use expressions to return the content.

     

    To access a nested item such as an email address you will need to locate the outputs from the Filter Array action. In my case, I'm using the Profile > Email for testing purposes.

     

    The expression I used to return the email address is:

    item()?['Manager']['Email']

     

    creativeopinion_8-1690781877311.png

     

    creativeopinion_9-1690781941921.png

     

    Again, the Compose actions are optional, however I would recommend at least ensuring your expressions are right before testing it out with the Send an Email (V2) action as it would be more efficient to develop your flow this way rather than waiting on an email to come through.

     

    Once you've confirmed the expressions are returning all the correct values, you can insert the expressions directly into the Send an Email (V2) action—or use the outputs from your Compose actions!

     

    Hope this helps!

     

     

     

     

     

     

  • RezzaB Profile Picture
    91 on at

    Morning @creativeopinion Thank you for your step-by-step, much appreciated. I have followed, but I am getting the expression is invalid for the compose Manager email

     

    RezzaB_1-1690844190001.png

     

    Could you please asssit me again. 

     

    Cheers,

    Renee

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    You have added brackets around the square brackets. My original expression was:

    item()?['Manager']['Email']

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard