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

Excel lists due dates, Power Automate sends reminder email, due dates not converting properly.

I have created an Excel workbook to keep track of upcoming expiration dates. There are 18 columns of information, but for simplicity's sake, I will reduce it to the most pertinent information. Each row lists a separate piece of data, an expiration date, and two calculated date fields. The two calculated date fields are based on the expiration date to convert the expiration date to a workday. The difference between the two calculated date fields is that the second one takes the expiration date and subtracts a month to create a "reminder" date. I will call the two calculated date fields "Calculated Expiration Date" and "Reminder Date".

 

From here, things diverge into two power automate flows that in essence do the same thing. I have a power automate flow that retrieves the list of information, filters by the Calculated Expiration Date, and then emails out the list of items that are expiring (the second one does the same thing, but uses the Reminder Date to send out an email a month before the Calculated Expiration Date).

 

The challenge I face currently is this:

Screenshot 2024-01-30 130831.png

 

I am using this exact flow to create a reminder email for another list that works as intended, so I'm puzzled as to why it won't work for this list. The differences between the workbooks are that I did not create the one I'm working on now, and it's saved on Sharepoint instead of my Onedrive. Neither of those seem likely to cause this problem. I have copied the formatting exactly from my other workbook, so the date should be working exactly the same.

I have tried to use the solution presented here, but it gives me the same result. I used the solution to produce this:

 

 

 

 

addseconds('1899-12-30',int(formatnumber(mul(float(triggerBody()['Reminder Date']),86400),'0')))

 

 

 

 

What have I done wrong?

6 REPLIES 6

In the action "List Rows Present in a Table" there is an option for DateTime format. 

wskinnermctc_0-1706654938495.png

 

Change the Date Time Format to ISO 8601.

 

The number 45321 is the Serial date from Excel. Power Automate can read Excel data as Serial or ISO 8601.

 

If the settings is ISO 8601:

equals(formatDateTime(item()?['Reminder Date'],'yyyy-MM-dd'),utcNow('yyyy-MM-dd'))

 

If the settings is in Serial:

equals(formatDateTime(addseconds('1899-12-30',int(formatnumber(mul(float(triggerBody()['Reminder Date']),86400),'0'))),'yyyy-MM-dd'),utcNow('yyyy-MM-dd'))

 

See if one of those helps you out

Thanks for the suggestion. I tried both of those out to no avail. What's strange is that some of the dates are coming through properly. Check out this screenshot.

Screenshot 2024-01-30 152639.png

 

The expiration date is coming through as a date, but the two calculated fields are not. I've converted them both in excel to serial numbers and then back to dates to make sure they are formatted properly and that they don't have any extra numbers that would indicate time. I've copied the formatting from the "Expiration Date" column to the other two to make sure they are consistent.

I can't think of what else to try other than making a whole new workbook and seeing if that does something.

The calculated dates are probably going to keep coming in as Serial if power automate doesn't recognize them as dates. So you will have to use the Serial type expression with the calculated fields. For the Expiration date, you will have to use the ISO 8601 expression.

 

Creating a new workbook is not going to change anything. It has to do with the values in the fields and how Power Automate reads them.

 

The error you show in your screenshot doesn't have to do with the workbook or values, it looks like it is entered incorrectly. (I'll take some blame for this, but really I just copied what you initially put assuming it was correct.

 

triggerBody()['Reminder Date'] is going to be incorrect.

"triggerBody" is referencing the body of the trigger, which is Recurrence. So this is not correct, you are not getting any values from the Recurrence trigger.

The error message says "cannot be evaluated because property "Reminder Date" cannot be selected". Which makes sense because there is no Reminder Date in the trigger.

 

So for the Expiration Date which is in ISO 8601 you could use the expression:

equals(formatDateTime(item()?['Expiration Date'],'yyyy-MM-dd'),utcNow('yyyy-MM-dd'))

 

For the Reminder Date that is in Serial format you could use the expression:

equals(formatDateTime(addseconds('1899-12-30',int(formatnumber(mul(float(item()?['Reminder Date']),86400),'0'))),'yyyy-MM-dd'),utcNow('yyyy-MM-dd'))

 

Also note that if you have any blank rows in your dates, this will cause an error and will most likely change the date type to Serial. See my post about when Excel date is blank.

josva
New Member

Thanks @wskinnermctc for the follow up.

 

What's throwing me off is that this flow worked on another email reminder flow I set up a year ago.

 

To try and isolate where the problem seems to be occurring I did a few additional tests:

 

I duplicated the workbook and flow for my other flow that is working (the one from a year ago) and then copied the data from the workbook with expiration dates into my duplicated workbook from a year ago, and the duplicated flow ran without errors.

 

I moved that duplicated workbook into SharePoint just to see if that did anything, repointed the flow to the new position, and it also ran just fine.

 

Just to see what would happen, I copied the sheet from the duplicated workbook into the workbook with expiration dates, repointed the flow and ran it again and it didn't work. The problem seems to be centered around the workbook with expiration dates.

 

I agree that there could be something happening on blank rows. I tried a few times to get your formulas to work, then tried adding a filter array step to filter out blank rows and couldn't figure it out. I was able to work around the blank rows by changing my IFERROR formula in the two calculated date fields to throw a "1" instead of "". It gives me "1/1/1900", but that won't interfere with anything, plus I can hide those columns so they aren't distracting.

 

I still don't get what the problem is, but I'm going to go with this version that is working.

I think the issue is trying to deal with calculated columns. Trying to leverage Excel functions like formulas/lookups, as a tool for Power Automate is usually a problem. You should get data into Power Automate, and then have PA perform the functions.

 

Whatever date checking or comparison you need to do about dates, do it in Power Automate. Use the Expiration Date and perform calculations in PA to get the results.

 

You could have Power Automate do the date calculation and condition when to send or not send emails. (Resource heavy since it has to perform the calculation on each Expiration Date every scheduled flow.)

or

You could have Power Automate do the date calculation and condition; then write back to the Excel workbook so that you only have dates in the "Calculated Expiration Date" and the "Reminder Date" columns as a reference for a Scheduled flow. (May require separate flows, or an additional condition check to know which dates to pull and perform calculations.)

 

I don't know when/how this workbook is updated. But I would find a method to only have dates as a reference instead of calculated formulas.

 

Another alternative is using an Excel Script. I do not have any experience with this, but it seems to be new and people have had success. You make the Script in the workbook, then use a PA flow to run the script and use the results.

If I was in your position, I would adjust the workbook/table so that a flow could add/calculate the dates needed, and also read the dates to send reminder emails.

 

Example:

Imagine your workbook had a table like this below. 

Name ProjectID Expiration Date Calculated Expiration Date Reminder Date Flow Status
Steve A123 11/25/2023 11/24/2023 11/1/2023 Completed
Ashley B321 2/17/2024 2/16/2024 2/1/2024 Reminder
Jack C987 3/23/2024     Calculate
Susan D789 4/27/2024     Calculate

 

I would make a scheduled flow that used the "Flow Status" column as a reference.

  • Completed - this row needs nothing and no emails or anything. Basically do nothing.
  • Reminder - this row needs an email sent on the reminder date
  • Calculate - this row needs the "Calculated Expiration Date" and "Reminder Date" filled in

 

The flow would run every day and use the Status column as a reference for what actions to perform:

  • Trigger - schedule run daily
  • List Rows 1 - filter by rows that have Flow Status of "Calculate"
    • For each of these rows calculate the correct "Calculate Expiration Date" and "Reminder Date"
    • For each of these rows update the two date columns and set Flow Status column as "Reminder"
  • Delay - 10 minutes to allow the workbook to complete and save
  • List Rows 2 - filter by rows that have Flow Status of "Reminder"
  • Filter Array - filter the List Rows 2 by Reminder Date is equal today
    • For Each row in Filter Array - send a reminder email
    • For Each row in Filter Array - Update row Flow Status to "Completed"

 

This is not a precise example, but it is a general idea of the approach I would use so it would be more solid and not depend on an Excel calculation.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages