Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Sending a birthday text based on Dynamics 365 date field

(2) ShareShare
ReportReport
Posted on by 42

Hi All,

I am really stumped on how I can implement a power automate flow which will be able to do the following:

Send a birthday text to candidates who's birthdays are today.

I created a field in Dynamics which has calculated the candidates birthday date for this year.

I then go to power automate to start a scheduled flow.

I want to be able to list the candidates who's 'birthday date' is today, however when I go to filter the query, no dynamic content appears:

Any ideas on how I could get this filter to work?

After I have this I can then add in our Twilio connector and send the text out

pastedimage1605636661337v1.png

  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    6,634 Super User 2025 Season 1 on at
    Sending a birthday text based on Dynamics 365 date field
    Hello Recruitment 2019,
     

    You're on the right track with a scheduled flow and the "List records" action in Power Automate. The issue you're facing with "No dynamic content available" in the Filter Query is a common one when dealing with date comparisons in Dataverse (formerly CDS).

    Here's a breakdown of why you're seeing this and how to construct the correct Filter Query to find contacts whose calculated birthday is today:

    Why "No Dynamic Content Available" in Filter Query:

    The "Filter Query" field in the "List records" action expects an OData filter expression as a string. It doesn't directly interact with the dynamic content picker in the same way as actions that allow you to directly compare fields. You need to manually construct the OData filter syntax.

    Constructing the OData Filter Query for Today's Birthday:

    You need to compare your calculated birthday date field with the current date. Here's how you can do it using the eq (equals) operator and the utcnow() function within an OData filter:

    1. Identify the Schema Name of Your Birthday Date Field:

      • In Dynamics 365, go to Settings > Customizations > Customize the System.

      • Expand Entities and find your Contact entity.

      • Click on Fields and locate the field you created for the calculated birthday date for this year.

      • Note down the Schema Name of this field. It will be a unique name usually starting with a prefix (e.g., new_calculatedbirthday). Let's assume your schema name is new_calculatedbirthday. 

    2. Construct the Filter Query:

      In the "Filter Query" field of your "List records" action, enter the following OData filter expression:

      new_calculatedbirthday eq @utcnow()

      Explanation:

      • new_calculatedbirthday: Replace this with the actual schema name of your calculated birthday date field.

      • eq: This is the OData operator for "equals."

      • @utcnow(): This is a Power Automate expression that returns the current date and time in Coordinated Universal Time (UTC). 

    3. Handling Time Zones (Important Consideration):

       

      The @utcnow() function provides the current date and time in UTC. Your Dynamics 365 environment and the data in your birthday field might be in a different time zone. To ensure accurate comparison, you might need to adjust for the time zone difference. Here are a couple of approaches:


      • Convert Birthday Field to UTC (Less Ideal for Calculated Fields): If your calculated birthday field stores the date in a specific time zone, you might need to convert it to UTC within the filter. This can get complex with calculated fields.

      • Compare Only the Date Part (Recommended): A more reliable approach is to compare only the date portion of both the birthday field and the current UTC date. You can achieve this using OData functions:

        date(new_calculatedbirthday) eq date(utcnow())

        This expression extracts only the date part from your birthday field and the current UTC date, ignoring the time component. This is generally the best approach for birthday checks.


      •  

    4.  

    Complete "List records" Action Configuration:

    Your "List records" action for Contacts should look something like this:

    • Entity name: Contacts

    • Select Query: (Optional) Select the attributes you need for sending the SMS (e.g., phone number, first name).

    • Filter Query: date(new_calculatedbirthday) eq date(utcnow()) (Replace new_calculatedbirthday with your actual schema name).

    • Order By: (Optional)

    • Top Count: (Optional)


    •  

    Next Steps in Your Flow:

    1. Initialize a Variable (Optional but Good Practice): You can initialize an array variable to store the contacts who have a birthday today.

    2. "Apply to each" Action: Add an "Apply to each" action to iterate through the list of contacts returned by the "List records" action.

    3. Twilio "Send SMS" Action: Inside the "Apply to each" loop, add your Twilio "Send SMS" action. Use the dynamic content from the "List records" action (e.g., the contact's phone number) to send the birthday text. You can also personalize the message with their name.

       


    4.  

    Troubleshooting Tips:

    • Verify Schema Name: Double-check that you have the correct schema name for your calculated birthday date field.

    • Test with a Specific Date: To test your filter query, you can temporarily replace date(utcnow()) with a specific date in the OData format (e.g., date(2025-04-26)). This will help you confirm if your filter logic is correct.

    • Check Time Zones: Be mindful of the time zone differences between your Dynamics 365 environment and UTC. The date() function should help mitigate this, but ensure your calculated birthday field stores the date correctly.

    • Flow Run History: After activating your flow, monitor the run history to see which contacts are being retrieved.

    •  

    By using the date() function in your OData Filter Query, you should be able to successfully retrieve the contacts whose calculated birthday date matches today's date, allowing you to proceed with sending your birthday SMS messages via Twilio.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • Suggested answer
    Bipin D365 Profile Picture
    28,977 Moderator on at
    RE: Sending a birthday text based on Dynamics 365 date field

    Hi,

    You can also use advanced find to first generate fetchxml then use xrmtoolbox fethcxml builder plugin to convert fetchxml to odata filter condition which can be easily placed in flow filter condition.

    Below I have the fetch xml where I am checking Contact entity whose birthday is today

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">

     <entity name="contact">

       <attribute name="fullname" />

       <attribute name="telephone1" />

       <attribute name="contactid" />

       <order attribute="fullname" descending="false" />

       <filter type="and">

         <condition attribute="birthdate" operator="today" />

       </filter>

     </entity>

    </fetch>

    Now I use this fetchxml in fetchxml builder xrmtoolbox plugin to generate flow filter condtion.

    CQ79.PNG

    Please mark my answer verified if i were helpful

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Sending a birthday text based on Dynamics 365 date field

    Hi,

    The utcNow is returning the timestamp which you need to convert to Date/Time format for comparison with Dynamics.

    Add a compose action and use this expression, and then use the output of this compose in the filter query.  

    formatDateTime(utcNow(),'yyyy-MM-dd')

  • Suggested answer
    LuHao Profile Picture
    40,884 on at
    RE: Sending a birthday text based on Dynamics 365 date field

    Hi partner,

    We will fill in the conditions in Filter Query instead of Select Query, and in Filter Query, we have to enter the field name instead of selecting dynamic content.

    pastedimage1605685071814v1.png

    For more information about Filter Query, please refer to this blog: https://diyd365.com/2019/11/20/every-power-automate-ms-flow-filter-query-you-ever-wanted-to-know-as-a-functional-consultant/

  • Suggested answer
    Adrian Begovich Profile Picture
    1,023 Super User 2025 Season 1 on at
    RE: Sending a birthday text based on Dynamics 365 date field

    Hi Recruitment 2019,

    This article explains how to automatically send emails on birthdays using Microsoft Flow. You will only need to make a slight modification to use Twilio instead of sending an 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans