cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Date Field - 45 days to trigger flow

I'm working with a date field in D365 customer record and trying trigger a flow if that date value = XX days from today. I've done the same down stream process using many other triggers from the D365 records but I don't see how to create this type of trigger.

 

Thanks in advance. 

 

Tracy

3 ACCEPTED SOLUTIONS

Accepted Solutions

The formatting goes into the left side of your Condition, here. Let me show you: 

Click where #1 is

 

Rhiassuring_0-1651795346393.png

 

Then, click on the Expression tab - #2. 

 

In there, you can enter this formula -- the orange part is the part where you need to add your Dynamic Content (in the tab to the left of Expressions, from above) from the Dataverse, probably called "Class Start Date" -- you can't leave it as text.

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

 

Then, click the OK button. 

Next, set your condition back to "is equal to".

 

Finally, your right hand expression will be the same as you had before and you enter it the same was as the one above, just in the right hand field:  addDays(UTCNow(),45,'yyyy-MM-dd')

So now you will have a nice purple expression on either side of your condition, like this:

 

Rhiassuring_1-1651795688423.png

 

edit: thank you to @vivekpande18 for pointing out my slip up here! Corrected! NO ONE WILL EVER KNOW.

 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



View solution in original post

vivekpande18
Super User
Super User

Hi @TracyLivingston  @TracyLivingston 

 

Just a small change in above solution. 

Make  sure you have same date format on both sides 

yyyy-MM-dd

 

It should not be different and I was talking about the same thing which @Rhiassuring  has explained above

View solution in original post

I understand what you are saying and really appreciate your patience 🙂

 

I've tried variations for two days but what I'm seeing is that it results in invalid expression, or the flow fails for IOS formatting.

TracyLivingston_0-1651814506712.png

 

 

The below part works fine, I can run "Class Start Date" by selecting from dynamic content  and then "contains" with the expression below and the flow works fine .

TracyLivingston_1-1651814579390.png

 

When I add the expression to reformat the starting value, I get the ISO 8601 error. The expression saves fine but on run the flow I get the IOS 8601 error above.

TracyLivingston_2-1651814919107.png

 

formatDateTime(vel_classstartdate,'yyyy-MM-dd') -- Saves fine and creates the expression but the flow breaks for bad ISO format at this point.

vel_classstartdate is the system id for the field, but it resolves back to Class Start Date when I reopen the expression after running (below).

formatDateTime('Class Start Date','yyyy-MM-dd')

And, I don't have the option of selecting the Dynamic Content for "Class Start Date". It's not in my list when  adding it to the expression.

TracyLivingston_3-1651815503473.png

 

BUT, it's an option if I simply select Dynamic Content as the entry option (not in the expression) as shown here:

TracyLivingston_4-1651815903155.png

 

@vivekpande18  @Rhiassuring you are both great and I'm sure I'm missing something so simple. Very frustrating and I appreciate the help. 

 

 

 

View solution in original post

20 REPLIES 20
Rhiassuring
Super User
Super User

To do this, you'd need to create a scheduled flow to run once daily, then use a condition - if date value equals addDays(UTCNow(),45,'dd-MM-yyyy'), then go down the yes path (where all your actions would be), and if not, just end the flow.

 

Cheers,

 

Rhia

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Thank you Rhiassuring!

 

This worked in terms of what it returns, but it's not mapping against my existing date value. I'm testing today +2 and a TRUE response should be 5-5-2022 (addDays(UTCNow(),2,'MM-dd-yyyy')) but the two test records I have with start dates on the 5th are not processing like I expect. Those should be the only two that trigger a response but I get the loop through all the records.

TracyLivingston_0-1651605258048.png

 

TracyLivingston_1-1651605820870.png

 

 

Rhiassuring
Super User
Super User

Hey @TracyLivingston - so, this is UTC, so depending on where you are, it might need some tweaking. 

Can you show me from your run history what the addDays formula is ending up to be? (And your timezone, if you don't mind.) 

I'm lazy so sometimes I just remove / add days depending on what I need, since I'm Pacific time zone - I'll just be like, oh, UTC is 8h ahead of me, I'm running this at 11P every night, so it's one day ahead of me ... so I'll just do add 1 day instead of add 2 days.


R

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Hi @Rhiassuring 

 

It looks like you expression is working fine. You can see from my Teams message (my debug) that the value is resolving to 5-5-2022 and I have two records with that date but they don't seem to be flagging as equal..Very frustrating 🙂

TracyLivingston_0-1651618290757.png

 

TracyLivingston_1-1651618329050.png

 

Rhiassuring
Super User
Super User

Ahh it looks like the format you'll need instead is yyyy-MM-dd for the date

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



@Rhiassuring  that worked, but  I had to change the qualifier to "contains" rather than is equal to which doesn't make sense to me but at least I can move forward with the rest of the flow and worry about that detail later.

 

Thanks for your help!!!

vivekpande18
Super User
Super User

Hi @TracyLivingston , 

Apply datetime formatting to your "Classs Start Date".

Ex - 

formatDateTime({{Start Class Date value}}, 'yyyy-MM-dd') 

Now, your both value have same formatting and you can compare it directly using "is eqaual to" . 

You  can get rid of "contains".

 

 

Thanks Vivek! But, I'm not clear where to apply the formatting in the flow?

 

TracyLivingston_0-1651761526071.png

 

 

vivekpande18
Super User
Super User

Hi @TracyLivingston , 

 

In condition, where you are comparing both 

Date fields

left parameter(data from crm) before Contains

 

if this solves your problem then don't forget to mark this as answer. This will help others as well

@vivekpande18,

 

Yes, I tried that first but getting an invalid expression error 😕 

 

formatDateTime({{vel_classstartdate}}, 'yyyy-MM-dd') 

 

Thanks for the help!

vivekpande18
Super User
Super User

Hi @TracyLivingston,

 

You can take use that expression inside compose action and use that compose action to compare.

It should work in this case.

Hi @vivekpande18

 

That gets me passed the invalid expression error but the flow still fails when it reaches the value.

 

TracyLivingston_1-1651793482963.png

 

TracyLivingston_0-1651793338772.png

 

formatDateTime('vel_classstartdate','dd/MM/yyyy hh:mm tt')

 

The formatting goes into the left side of your Condition, here. Let me show you: 

Click where #1 is

 

Rhiassuring_0-1651795346393.png

 

Then, click on the Expression tab - #2. 

 

In there, you can enter this formula -- the orange part is the part where you need to add your Dynamic Content (in the tab to the left of Expressions, from above) from the Dataverse, probably called "Class Start Date" -- you can't leave it as text.

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

 

Then, click the OK button. 

Next, set your condition back to "is equal to".

 

Finally, your right hand expression will be the same as you had before and you enter it the same was as the one above, just in the right hand field:  addDays(UTCNow(),45,'yyyy-MM-dd')

So now you will have a nice purple expression on either side of your condition, like this:

 

Rhiassuring_1-1651795688423.png

 

edit: thank you to @vivekpande18 for pointing out my slip up here! Corrected! NO ONE WILL EVER KNOW.

 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



vivekpande18
Super User
Super User

Hi @TracyLivingston  @TracyLivingston 

 

Just a small change in above solution. 

Make  sure you have same date format on both sides 

yyyy-MM-dd

 

It should not be different and I was talking about the same thing which @Rhiassuring  has explained above

Rhiassuring
Super User
Super User

Ahhh good catch! I'm going to update my post before he sees it so I don't confuse him >_>

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Perfect!!! 

I understand what you are saying and really appreciate your patience 🙂

 

I've tried variations for two days but what I'm seeing is that it results in invalid expression, or the flow fails for IOS formatting.

TracyLivingston_0-1651814506712.png

 

 

The below part works fine, I can run "Class Start Date" by selecting from dynamic content  and then "contains" with the expression below and the flow works fine .

TracyLivingston_1-1651814579390.png

 

When I add the expression to reformat the starting value, I get the ISO 8601 error. The expression saves fine but on run the flow I get the IOS 8601 error above.

TracyLivingston_2-1651814919107.png

 

formatDateTime(vel_classstartdate,'yyyy-MM-dd') -- Saves fine and creates the expression but the flow breaks for bad ISO format at this point.

vel_classstartdate is the system id for the field, but it resolves back to Class Start Date when I reopen the expression after running (below).

formatDateTime('Class Start Date','yyyy-MM-dd')

And, I don't have the option of selecting the Dynamic Content for "Class Start Date". It's not in my list when  adding it to the expression.

TracyLivingston_3-1651815503473.png

 

BUT, it's an option if I simply select Dynamic Content as the entry option (not in the expression) as shown here:

TracyLivingston_4-1651815903155.png

 

@vivekpande18  @Rhiassuring you are both great and I'm sure I'm missing something so simple. Very frustrating and I appreciate the help. 

 

 

 

Rhiassuring
Super User
Super User

Wait, Class Start Date is resolving back to text on its own from the vel_ thing you had before!? That's a bug - no way there's not a bug.

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Yes 🙂 that's exactly what I'm seeing.

Helpful resources

Announcements

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

Users online (5,299)