cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yattering82
New Member

FLOW TO SEND EMAIL WHEN DATE APPROACHES

Hi there

 

This is the first time posting in the forum but a long time user of the forum. What I am trying to do, is to get a flow to trigger an sending an email when the date of a required audit approaches. The audit due dates are listed in a SharePoint list and you would think that this would be a simple thing to do. However, no matter how much I tinker and how much I see what others have done, I cannot get this to work.

 

This is what I have done:

 

@equals(item()?['Nextauditdue'], adddays(utcnow(),'mm-dd-yyyy')+14)

 

So basically I want this to send me an email when it is 14 days to the audit due date. 

 

If anyone can shed light on this, I would be most grateful.

117 REPLIES 117

@Anonymous

 

We would need to do similar to what we did before. Setup a dummy date that's unique (1/1/2049), run your Flow, go to results, Get Items -> Outputs -> Body and then hit ctrl+f and search for that year and see if you can find it. Then, that should give show you how SharePoint see your column name.

Anonymous
Not applicable

@kristof805

 

It is working!! Thank you so much!!!!! You have been a great help. Thanks so much for taking the time 🙂

@Anonymous

 

Yessss! That's awesome! Congrats Heart. It's awesome because now through all that troubleshooting, building anything similar will be so much simpler. Cheers!

Wow,

gotta say this is a GREAT thread and I have dedicated a few days at going back and forth here.

I finally reached a good point with my testing...

 

BUT

 

My dates seem to only be working with month and day -- ignoring the year.

 

I'm using;

@less(formatDateTime(item()?['reminder_x0020_email'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), 01), 'MM/dd/yyyy'))

 

I have (3) items in my share point list with dates of 

A> 10/1/2018

B> 10/12/2018

C> 3/29/2019

 

I can consistenly get an email for both A & C but C is in 2019...

 

can anyone help shed some light?

 

 

EDIT:::::

I should add that I can live life without the addition of days, so I'm eagerly open to any suggestions on how I can simply have my flow check that date column and if it matches the date of today = send email

 

 

 

::::: EDIT #2 :::::

ok, I got it to work with this one and posting up for fuuture me to review as needed.

 

@equals(formatDateTime(item()?['reminder_x0020_email'], 'MM/dd/yyyy'), formatDateTime(utcNow(), 'MM/dd/yyyy'))

@chico glad this was helpful and that you found your solution. No idea why your 2019 wasn't being checked. I only use mine with a "is today 30 days away from the date in the column"? If yes, it sends the e-mail and if not, nothing happens.

 Hi Kris,

 

Thanks for sharing this. I've successfully made 3 reminders - 14, 7, and 1 day before the date in my SharePoint list column.

 

However, I just tried to do one where it sends a notification when the Current Date is after the deadline, where it will send an email to the "backup person" every day - from 2 days after the deadline.

This failed - and by that I mean it sent out a bunch of emails even though the date is not yet passed. 

 

This was my code:

@less(formatDateTime(item()?['Review_x0020_Date'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), 2), 'MM/dd/yyyy'))

Do you know a way to make this work correctly?

Hey @tehfunnie

 

I haven't really delt with anything like what you are thinking of. You could play around with like trying to get that logic to check if the today's date minus two days is equal to your date in your SharePoint list but I'm not quite sure of the syntax of it all ... maybe something like this:

 

 

@equals(formatDateTime(item()?['Review_x0020_Date'], 'MM/dd/yyyy'), formatDateTime(addDays(utcNow(), -2), 'MM/dd/yyyy'))

 

I have not tested this and there might be a subtractDays function that might help you but my theory is that it should work with the addDays as I have it in the code and the -2. So you'd have your Review Date from your list be, for example, 10/27/2018. Then your Flow runs today and takes today's date, 10/29/2018 and adds -2 days (aka subtracts two days) for 10/27/2018, dates match, and in theory and e-mail goes out?

 

Let me know if you get it working.

 

Anonymous
Not applicable

Hello everyone, thank you in advance on providing advice on an issue I am facing with this Flow. I was able to get it perform the basic action, meaning it sends an email 30 days before a date is approaching. However, the Flow still says failed and there are multiple error messages.

 

Error 1: Action failed, no dependent actions succeeded - Under Inputs, the Expression result says 'false'

 

Error 2: Action failed, no dependent actions succeeded - Invalid template, unable to process template language expressions for action 'Condition' at line '1' and column '2498':  Run History | Microsoft Flow

'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'
 
Even though I am getting what I need from the Flow (which is sending an email) I want to figure out why this Flow is still failing - is it because it is a long list and the condition is not met everytime an item is not the due date? I am pretty sure I am doing something wrong and need your help to identify.
 
My SharePoint list's column type is 'Date and Time' and it does not have any time in it. I am also attaching a screenshot, thank you again.
 
Capture1.PNG
ganeshnalawade
New Member

Hi All,

Can anyone help me to set flow for the following condition

 

StatusRoot CauseBusiness ImpactManagement Action PlanResponsibilityDue Date

this is the list , i want to set reminder to the responsibal person ( responsibilty column) to get auto email reminders before due date(due date column). which template to select or to create custome template.

 

i am using online sharepoint. Thanks in advanced.

 

Regards,

Ganesh

 

 

@ganeshnalawade

 

Please check out what other people or myself have done in the thread. The accepted solution on page one should give you a really good refernece.

 

Your code / layout for that Flow would look something like the following:

  • recurrence (when do you want Flow to check this? I have it check it once a day)
  • get items (from your list)
  • apply to each
  • condition (check if your due date is today, the correct code is in this thread several times)
  • if yes
    • grab the e-mail address from responsibility column and send that person an e-mail
  • if no
    • no action (you can leave it blank)

 

@Anonymous

 

My guess is that there might be a line in your List that does not have a date? That would cause it to be "null" aka not present. At this point, I'm pretty sure Flow just moves onto the next item but technically, for that line, it failed as it couldn't evaluate the date: it couldn't compare today's date against nothing.

 

That's just my guess from looking at what you posted. This would refer to Error 2, I think. Error 1, I think, is related because if your condition fails, it can't really move onto the If Yes and If No steps of your Flow. You COULD adjust your Flow to first check if there is a Date present, and if not, leave blank and if yes, then compare that date to today but I don't think it's worth the trouble.

Anonymous
Not applicable

Wow, thank you so much @kristof805! I checked and I did have many blanks, upon adding a date, the Flow ran successfully.

lgonyea22
Regular Visitor

This has been very helpful information. Thank you all. While applying to the original list the date column failed to be recognized by Flow, a rebuilt list and content type was successful. My additional requirement is to add multiple intervals of 90 days, 30 days, 7 days, expired or zero day. What is the recommendation for best practice to add multiple intervals?

  1. One expression with all intervals and a single email body output - what would that look like?
  2. Stacked conditions continuing under the Yes side for each interval?
  3. Separate/multiple Flows for each condition?

I've seen others use 1 day, can we use 0 for expired the day of?

I went with the stacked condition route and it worked like a charm. A peer had suggested to use the Switch control to have the Case properties stacked horizontally vs vertically, but the Case property did not approve of the expression that's been provided throughout this string. Looking for a more literal string.

switch_error.jpg

@lgonyea22, for simplicity's sake, I would actually make one working flow with whatever day offset you want, let's say 90 days, and then make a copy of that Flow and just adjust the day offset. Sure, you'll have multiple Flows but it they all be smaller and less complicated. Also, if one breaks, you only have to troubleshoot that one, instead of your switch / case or multiple if / then statement Flow. Good luck!

JV2018
Regular Visitor

Wondering if anyone might be able to shed some light on how I might set the condition logic to send the email to the doc owner when any of the docs' reviewed date is older than one year. 

Any insights would be greatly appreciated!

@JV2018, the main answer / logic should work, except you'd change the days value to be 365 and you'd put a plus instead of a minus.

 

Maybe something like:

@equals(formatDateTime(item()?['Date'], 'MM/dd/yyyy'), formatDateTime(subtractDays(utcNow(), 365), 'MM/dd/yyyy'))

Thanks!!!

I just realized that its missing one other piece. I have selected properties of all of the documents but have not singled out the 'last review date' for this condition. Can you possibly advise where that would be woven in?

 

2019-01-14_14-47-52.jpg

@JV2018, I guess I haven't been on the Flow website because now Flows that ran successfully don't have the output provided neatly formatted on the results page. Instead you get to download it.

 

Anyway, inside the output there should be a modified value that you might be able to work off of in your next step. I'm not really familiar with this part of the process though, it's just my best guess. You might want to start a separate and your question might get more exposure.

Network-iQ
Frequent Visitor

Hello -

This is the thread I have been looking for! BUT!

I do not have an

"EDIT IN ADVANCED MODE" option! Have I added the incorrect control? Please advise!

 

Thanks so much!

 

Screenshot

 

Helpful resources

Announcements

It's #MPPC23 Week! Check Out the Community Sessions and Events Happening in Vegas

After all the planning and preparing, the annual Microsoft Power Platform Conference is finally here! We are excited to see so many of our community in Las Vegas this week. To help make sure you don't miss any of the workshops, sessions, and events we have planned, make sure to check out this handy Community One-Sheet, and download the pdf today! Make sure to stop by the Community Lounge to meet @hugobernier, @EricArcher, @heaher_italent, and @AshleyFelts from our team!    

Join Us for the First-Ever Biz Apps Community User Group Meeting: Live from MPPC23

      Join us for the first-ever the Biz Apps Community User Group meeting live from the Power Platform Conference! This one hour user group meeting is all about discovering the value and benefits of User Groups! Discover how you can find a group in your local area or about specific topics where you can learn new skills and meet like-minded people as a user group member.   Hear from User Group leaders about why they do what they do and what resources they receive to help them succeed as community ambassadors. If you have never attended a User Group meeting before, this will be a great introduction! We hope you are inspired to find a group that meets your unique interests!   October 5th at 2:15 pm Pacific time   If you're attending #MPPC23 in Las Vegas, join us in person! Find out more here: https://powerplatformconf.com/#!/session/Biz%20Apps%20Community%20User%20Group%20Meeting%20-%20Live%20from%20MPPC/6172   Not at MPPC23? Attend vvirtually by registering here: https://aka.ms/MPPCusergroupmeeting2023    If you can't attend this meeting live, don't worry! We will record this meeting and share it with the Community at powerusers.microsoft.com 

Back to Basics: Tuesday Tip #1: All About YOUR Community Account

We are excited to kick off our new #TuesdayTIps series, "Back to Basics." This weekly series is our way of helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we will feature new areas of content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other!     This Week's Tips: Account Support: Changing Passwords, Changing Email Addresses or Usernames, "Need Admin Approval," Etc.Wondering how to get support for your community account? Check out the details on these common questions and more. Just follow the link below for articles that explain it all.Community Account Support - Power Platform Community (microsoft.com)   All About GDPR: How It Affects Closing Your Community Account (And Why You Should Think Twice Before You Do)GDPR, the General Data Protection Regulation (GDPR), took effect May 25th 2018. A European privacy law, GDPR imposes new rules on companies and other organizations offering goods and services to people in the European Union (EU), or that collect and analyze data tied to EU residents. GDPR applies no matter where you are located, and it affects what happens when you decide to close your account. Read the details here:All About GDPR - Power Platform Community (microsoft.com)   Getting to Know You: Setting Up Your Community Profile, Customizing Your Profile, and More.Your community profile helps other members of the community get to know you as you begin to engage and interact. Your profile is a mirror of your activity in the community. Find out how to set it up, change your avatar, adjust your time zone, and more. Click on the link below to find out how:Community Profile, Time Zone, Picture (Avatar) & D... - Power Platform Community (microsoft.com)   That's it for this week. Tune in for more Tuesday Tips next Tuesday and join the community as we get "Back to Basics."

Announcing the MPPC's Got Power Talent Show at #MPPC23

Are you attending the Microsoft Power Platform Conference 2023 in Las Vegas? If so, we invite you to join us for the MPPC's Got Power Talent Show!      Our talent show is more than a show—it's a grand celebration of connection, inspiration, and shared journeys. Through stories, skills, and collective experiences, we come together to uplift, inspire, and revel in the magic of our community's diverse talents. This year, our talent event promises to be an unforgettable experience, echoing louder and brighter than anything you've seen before.    We're casting a wider net with three captivating categories:  Demo Technical Solutions: Show us your Power Platform innovations, be it apps, flows, chatbots, websites or dashboards... Storytelling: Share tales of your journey with Power Platform. Hidden Talents: Unveil your creative side—be it dancing, singing, rapping, poetry, or comedy. Let your talent shine!    Got That Special Spark? A Story That Demands to Be Heard? Your moment is now!  Sign up to Showcase Your Brilliance: https://aka.ms/MPPCGotPowerSignUp  Deadline for submissions: Thursday, Sept 28th    How It Works:  Submit this form to sign up: https://aka.ms/MPPCGotPowerSignUp  We'll contact you if you're selected. Get ready to be onstage!  The Spotlight is Yours: Each participant has 3-5 minutes to shine, with insightful commentary from our panel of judges. We’re not just giving you a stage; we’re handing you the platform to make your mark.     Be the Story We Tell: Your talents and narratives will not just entertain but inspire, serving as the bedrock for our community’s future stories and successes.    Celebration, Surprises, and Connections: As the curtain falls, the excitement continues! Await surprise awards and seize the chance to mingle with industry experts, Microsoft Power Platform leaders, and community luminaries. It's not just a show; it's an opportunity to forge connections and celebrate shared successes.    Event Details:  Date and Time: Wed Oct 4th, 6:30-9:00PM   Location: MPPC23 at the MGM Grand, Las Vegas, NV, USA  

September User Group Success Story: Reading Dynamics 365 & Power Platform User Group

The Reading Dynamics 365 and Power Platform User Group is a community-driven initiative that started in September 2022. It has quickly earned recognition for its enthusiastic leadership and resilience in the face of challenges. With a focus on promoting learning and networking among professionals in the Dynamics 365 and Power Platform ecosystem, the group has grown steadily and gained a reputation for its commitment to its members!   The group, which had its inaugural event in January 2023 at the Microsoft UK Headquarters in Reading, has since organized three successful gatherings, including a recent social lunch. They maintain a regular schedule of four events per year, each attended by an average of 20-25 enthusiastic participants who enjoy engaging talks and, of course, pizza.   The Reading User Group's presence is primarily spread through LinkedIn and Meetup, with the support of the wider community. This thriving community is managed by a dedicated team consisting of Fraser Dear, Tim Leung, and Andrew Bibby, who serves as the main point of contact for the UK Dynamics 365 and Power Platform User Groups.   Andrew Bibby, an active figure in the Dynamics 365 and Power Platform community, nominated this group due to his admiration for the Reading UK User Group's efforts. He emphasized their remarkable enthusiasm and success in running the group, noting that they navigated challenges such as finding venues with resilience and smiles on their faces. Despite being a relatively new group with 20-30 members, they have managed to achieve high attendance at their meetings.   The group's journey began when Fraser Dear moved to the Reading area and realized the absence of a user group catering to professionals in the Dynamics 365 and Power Platform space. He reached out to Andrew, who provided valuable guidance and support, allowing the Reading User Group to officially join the UK Dynamics 365 and Power Platform User Groups community.   One of the group's notable achievements was overcoming the challenge of finding a suitable venue. Initially, their "home" was the Microsoft UK HQ in Reading. However, due to office closures, they had to seek a new location with limited time. Fortunately, a connection with Stephanie Stacey from Microsoft led them to Reading College and its Institute of Technology. The college generously offered them event space and support, forging a mutually beneficial partnership where the group promotes the Institute and encourages its members to support the next generation of IT professionals.   With the dedication of its leadership team, the Reading Dynamics 365 and Power Platform User Group is poised to continue growing and thriving! Their story exemplifies the power of community-driven initiatives and the positive impact they can have on professional development and networking in the tech industry. As they move forward with their upcoming events and collaborations with Reading College, the group is likely to remain a valuable resource for professionals in the Reading area and beyond.  

A Celebration of What We've Achieved--And Announcing Our Winners

As the sun sets on the #SummerofSolutions Challenge, it's time to reflect and celebrate! The journey we embarked upon together was not just about providing answers – it was about fostering a sense of community, encouraging collaboration, and unlocking the true potential of the Power Platform tools.   From the initial announcement to the final week's push, the Summer of Solutions Challenge has been a whirlwind of engagement and growth. It was a call to action for every member of our Power Platform community, urging them to contribute their expertise, engage in discussions, and elevate collective knowledge across the community as part of the low-code revolution.   Reflecting on the Impact As the challenge ends, it's essential to reflect on the impact it’s had across our Power Platform communities: Community Resilience: The challenge demonstrated the resilience of our community. Despite geographical distances and diverse backgrounds, we came together to contribute, learn, and collaborate. This resilience is the cornerstone of our collective strength.Diverse Expertise: The solutions shared during the challenge underscore the incredible expertise within our community. From intricate technical insights to creative problem-solving, our members showcased their diverse skill sets, enhancing our community's depth.Shared Learning: Solutions spurred shared learning. They provided opportunities for members to grasp new concepts, expand their horizons, and uncover the Power Platform tools' untapped potential. This learning ripple effect will continue to shape our growth. Empowerment: Solutions empowered community members. They validated their knowledge, boosted their confidence, and highlighted their contributions. Each solution shared was a step towards personal and communal empowerment. We are proud and thankful as we conclude the Summer of Solutions Challenge. The challenge showed the potential of teamwork, the benefit of knowledge-sharing, and the resilience of our Power Platform community. The solutions offered by each member are more than just answers; they are the expression of our shared commitment to innovation, growth, and progress!     Drum roll, Please... And now, without further ado, it's time to announce the winners who have risen above the rest in the Summer of Solutions Challenge!   These are the top community users and Super Users who have not only earned recognition but have become beacons of inspiration for us all.   Power Apps Community:  Community User Winner: @SpongYe Super User Winner: Pending Acceptance Power Automate Community:  Community User Winner: @trice602 Super User Winner: @Expiscornovus  Power Virtual Agents Community: Community User Winner: Pending AcceptanceSuper User: Pending Acceptance Power Pages Community: Community User Winner: @OOlashyn Super User Winner: @ChristianAbata   We are also pleased to announced two additional tickets that we are awarding to the Overall Top Solution providers in the following communities:    Power Apps: @LaurensM   Power Automate: @ManishSolanki    Thank you for making this challenge a resounding success. Your participation has reaffirmed the strength of our community and the boundless potential that lies within each of us. Let's keep the spirit of collaboration alive as we continue on this incredible journey in Power Platform together.Winners, we will see you in Vegas! Every other amazing solutions superstar, we will see you in the Community!Congratulations, everyone!

Users online (3,691)