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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Birthday Alert Flow no...
Power Automate
Answered

Birthday Alert Flow not yielding expected results

(0) ShareShare
ReportReport
Posted on by 297

My data is in Dataverse in a table called CLIENTS.

Step 1: Recurrence

Interval: 1,

Frequency: day,

Time Zone UCT+2

no problem here

 

Step 2: List Rows

Table Name: Clients

Select Columns: cr40f_name, cr40f_dob

Filter Rows: cr40f_activeclient eq true and cr40f_dob ne null

no problem here (I think)

 

Step 3: Initialize Variable

Name: DOB

Type: String

Value: 01-Jan

 

Step 4: Apply to each

Select an output from previous steps: body/value

Not sure about this one

 

Step 5: Set Variable

Name: DOB (variable initialized in step 3)

Value: formatDateTime((items('Apply_to_each')?['cr40f_dob']), 'dd-MMM')

Is this correct???

 

Step 5: Condition (to check whether birthday is today)

Expression: DOB (variable) is equal to formatDateTime(utcNow(),'dd-MMM')

Is this correct???

 

If true: send an email to myself.

If not true, no further action.

 

The flow runs without error, but doesn't send the email and there is a client with a birthday today.

 

Please help. This is driving me around the bend. It should be so **bleep** simple, but somehow I am missing something.

I wish I could run a flow in debugging mode to see the result of each step!

Categories:
I have the same question (0)
  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @hildasteyn 

     

    Pls check the output of step 5 action or expression '"ormatDateTime((items('Apply_to_each')?['cr40f_dob']), 'dd-MMM')" in the last flow run instance. It should be in dd-MMM format.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Hilda Steyn Profile Picture
    297 on at

    How do I check the output?

  • NathanAlvares24 Profile Picture
    1,714 Moderator on at

    Hi @hildasteyn !

     

    Use a compose action before that. Paste the expression of what @ManishSolanki has suggested in that.

  • Hilda Steyn Profile Picture
    297 on at

    Check my post. That is exactly what I have in there. 

  • grantjenkins Profile Picture
    11,063 Moderator on at

    What is the datatype for your DOB (cr40f_dob) column in your Dataverse Table? If it's not Date can you show exactly how you are entering the DOB (is it just the month and year, or the actual date of birth including day month and year)?

  • Hilda Steyn Profile Picture
    297 on at

    Data type is date only.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    This is how I'd build the flow.

     

    For this example, I've used the following Dataverse Table.

    grantjenkins_0-1698845306842.png

     

    Below is the full flow. I'll go into each of the actions.

    grantjenkins_0-1698846356740.png

     

    Recurrence runs daily which is what you already have.

    grantjenkins_2-1698845364995.png

     

    List rows retrieve all the rows that are active and DOB isn't null (as what you already have).

    grantjenkins_3-1698845405916.png

     

    Today is a Compose that gets today's date using the following expression.

     

    formatDateTime(utcNow(), 'dd MMM')

     

    Select extracts out just the fields I want to use. This just makes it easier with the rest of the flow.

    grantjenkins_4-1698845566171.png

     

    Filter array retrieves the Clients with a birthday today using the output from Today and following expression.

     

    formatDateTime(item()?['DOB'], 'dd MMM')

     

    grantjenkins_5-1698845688626.png

     

    Condition checks to see if the length of our Filter array is greater than 0 (at least one birthday).

     

    length(body('Filter_array'))

     

    grantjenkins_6-1698845750839.png

     

    If Condition is true it goes into the Yes branch.

     

    Style HTML table is a Compose that contains some CSS for styling the HTML table.

     

    <style>
     table {
     border-collapse: collapse;
     }
     table td,
     table th {
     border: 1px solid #ddd;
     padding: 5px 10px;
     text-align: left;
     }
     table th {
     background-color: #1C6EA4;
     color: white;
     }
    </style>

     

    grantjenkins_7-1698845810454.png

     

    Create HTML table uses the output from the Filter array and maps the fields I want to show in my HTML table.

     

    //Name
    item()?['Name']
    
    //Email
    item()?['Email']

     

    grantjenkins_8-1698845881106.png

     

    Send an email uses the output from Today in the Subject and the output from Style HTML table and Create HTML table in the Body.

    grantjenkins_10-1698846021329.png

     

    Below is an example of the email received.

    grantjenkins_12-1698846172913.png

  • Hilda Steyn Profile Picture
    297 on at

    Grant you have gone through so much trouble to answer, and I truly appreciate it. 

    Unfortunately, the table won't suffice. There is a whole lot of other information that will go into the email eventually about the individual client, so it's one email per client. 

    I suspect my problem is the setting of the variable and the comparison of that to today's date. Somewhere there I am missing something stupid. Would you please have a look at that and give me your thoughts?

  • Verified answer
    Hilda Steyn Profile Picture
    297 on at

    I solved my issue. I used compose instead of variables. First compose to get the DOB, second one to format it to dd-MMM only. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard