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

Flow "Successful" but not really..

Hi Power Automate World, 

Another Newb question from me. I'm testing a simple flow I created that renders a successful status at each run, but the final step isn't being completed because the conditions are all coming back "false" but there's one I've purposely made "true" for testing. I think the hangup is somewhere in the condition I have set up, and I can't tell if the fix lies in PA or within the Excel Doc I'm using. 

 

Here's my flow. I've tried both "Apply to Each" and/or "For Each" and neither yield the result I need. 

rtaylor1stComm_0-1713911189657.png

My condition is set to look for Days Left to be equal to 160 and if "True" send an email to the user (me, in this test case) notifying the user that their license is due soon.

rtaylor1stComm_2-1713911398197.png

 

The example below is a shot of the row I have set up in my table to test. You can see "Days Left" is 160. This is the 29th row of my table. 

rtaylor1stComm_1-1713911360649.png

 

However, when the test runs, I get a message over at the "Send Email" step that says ActionBranchingCondition is not satisfied, and when I go through each row entry, I come to row 29 and see that the came back "false" instead of true, even though Days Left does equal 160

rtaylor1stComm_4-1713911599352.png

 

I've run the mill of ways to edit, but again, I'm not sure if this actual flow or the way I have "160" formatted in the Excel table. I have it as a Number format because I have a formula running that calculates amount of days from today's date to the actual due date. 

 

Any advice would be appreciated as I learn this program. 

1 ACCEPTED SOLUTION

Accepted Solutions

It works, finally! Watched a simple videon the date formatting. Chose to try the addDays(utcnow(),145,MM/dd/yyyy') expression in the email body and it's working now. From start to finish. Thanks everyone for all the patience and input. 

View solution in original post

20 REPLIES 20
SudeepGhatakNZ
Multi Super User
Multi Super User

I can take a look on a Teams call. Are you available now?

 

 

If my suggestion helped you, please give it a Thumbs up and Mark it as a Solution so that it can benefit others in the community.
Sudeep Ghatak
Microsoft MVP, Business Applications
www.sudeepghatak.com

Thank you for your suggestion; however, being that I'm using my work network and server, I won't be able to take you up on that Teams call for security reasons. 

 

thank you, 

@rtaylor1stComm Instead of using an Apply to Each (aka For Each) and Condition action to loop through each row in your Excel table to see which rows meet your criteria. It's a lot more efficient to use a Filter Array action or a Filter Query in the List Rows Present in a table action.

 

If using a Filter Query in the List Rows Present in a table action, you need to ensure your column header doesn't have any spaces.

 

creativeopinion_0-1714420170374.png

 

creativeopinion_1-1714420213588.png

 

Note: The List rows present in a table action returns up to 256 rows by default. In order to get all rows, you will need to toggle on pagination and set a threshold. 

creativeopinion_2-1714420263157.png

creativeopinion_3-1714420274704.png

Whenever I use a Filter Query in a List Rows Present in a Table action, I always like to return the count of items returned in a Compose action. This is helpful when building a flow and can also be used to troubleshoot your flow.

Insert a Compose action. Add an Expression. Use the length() function.

 

creativeopinion_4-1714420306059.png

Select the Dynamic content tab and insert the body dynamic content from the Filter Array action into the length() function.

creativeopinion_5-1714420316056.png

 

Add a Condition action to your flow. If items have returned (aka there is number stored in the Compose action—that is not equal to 0), add the rest of your actions to the Yes branch. If not, do nothing.

creativeopinion_6-1714420390312.png

 

 

For more flow troubleshooting tips—check out this YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows

 

In this Power Automate tutorial, I explore 5 frequently asked questions that pop up when troubleshooting a flow. If you’d like to to level up your Power Automate flow skills and learn how to troubleshoot your Power Automate flow—this tutorial is for you!

 

IN THIS VIDEO:

 How to troubleshoot a false Condition action result

 How to get dynamic content when it isn’t selectable from the list of dynamic content

 How to troubleshoot an Apply to Each action that isn’t looping through

 How to troubleshoot a skipped Apply to Each action

 How to troubleshoot a Filter Query

 How to use a SharePoint yes/no column in a Filter Query

 How to use Compose actions to troubleshoot a Power Automate flow

How to troubleshoot multiple emails being sent

 How to troubleshoot multiple Teams messages being sent

 

Hope this helps!

If I helped you solve your problem—please mark my post as a solution .
Consider giving me a 👍 if you liked my response!

👉 Level up your Power Automate skills by checking out my tutorials on YouTube
👉 Tips and Tricks on TikTok and Instagram

 

 

Thanks for this. I did try it, and got a little confused at "Add a condition" when  you said if items are returned (aka there's a number stored in your Compose action). I just built the flow almost verbatim how you suggested, using the length expression in the Compose action. So, I'm a little confused on what you mean by "number stored" there. 

@rtaylor1stComm When you run a test, the Compose action will output a number. This number will indicate how many items have returned from whatever you've inserted into the length() function. In your case, it'll be the number of rows returned from the List Rows Present in a table action.

 

Thank you, 

The test keeps failing so I don't have a number generated; however, I have 31 rows on my excel list (at the time) I don't ever see it growing to be over 256 rows, so is the Pagination option necessary? 

 

Thanks for all your help. What's so frustrating is my original flow worked and sent out emails successfully at a time; however, I went in to edit the flow just to fix a date-formatting error within the email body of the last action, and it hasn't worked since. 

@rtaylor1stComm can you please share a screenshot of your full flow in the Classic designer with all actions expanded (in edit mode)? Also, if you are switching between the new designer and classic designer I'd recommend sticking with the classic designer as the new designer is still buggy.  

 

If your excel table will never go over 256 rows, then toggling on pagination isn't necessary. 

So what I've done now, is start from scratch and test each action/step of the flow before adding anything else. My test number to find in the DaysLeft column of my excel table is 145. From the screenshots, you can see my Compose actions is in fact bringing back 145 from the 30th row of the table. 

rtaylor1stComm_0-1715279296492.png

 

Going from there, I add a Condition and it creates the For Each. I need to choose an output from the previous step. I only have the options you see in the next screenshot, so I select it. 

 

rtaylor1stComm_1-1715279350534.png

 

From there, my Condition window pops up and from the Dynamic Content list, I have the columns of my table and some other options to choose.

rtaylor1stComm_2-1715279496681.png

 

 

This is where it gets tricky! I've tried everything I thought would work at this step, however--all results come back "false" and therefore I'm not ready to add the next action. It's saying it's successful, because it didn't run into errors, but to not see the 145 as "true" is an error for me. 

 

 

I'll update my lastest reply with screenshots of the Classic Mode. I hadn't seen your request for this before posting. 

It doesn't like when I do the Filter Query. It fails and says 'BadRequest' any time I add it. It passes at least this first step when I don't have it. 

 

rtaylor1stComm_0-1715281891166.png

 

 

Flow in Edit Mode 

rtaylor1stComm_1-1715281914615.png

 

 

@rtaylor1stComm I would stick with working in the Classic Designer as the New Designer is still buggy. I believe you have the length() expression set up incorrectly. Can you try again? Following these steps?

creativeopinion_0-1715284969098.png

 

Select the Dynamic content tab and insert the body dynamic content from the Filter Array action into the length() function.

creativeopinion_1-1715284969097.png

 

You can reference this section of my YT Tutorial to see a demo of this. Although this demo is returning the count of SP Items, you can apply to concept to the List Rows Present in a Table action. Insert the value dynamic content into the length() function. 

 

Hope this helps!

If I helped you solve your problem—please mark my post as a solution .
Consider giving me a 👍 if you liked my response!

👉 Level up your Power Automate skills by checking out my tutorials on YouTube
👉 Tips and Tricks on TikTok and Instagram

 

I have the expression as 

length(outputs('List_rows_present_in_a_table')?['body/value']). This was generated after I set the cursor inside of the parentheses, then selected Dynamic Content/Value

@rtaylor1stComm Is the Compose action still outputting an error or does it output a value?

the List Rows Action is still failing due to 'BadRequest'. This only happens when I have something the Filter Query. Here's a screenshot. Note: I've tried both putting quotations around 145, and not. In this screenshot the quotations are there, but either way causes a fail. 

 

rtaylor1stComm_0-1715290973248.png

 

@rtaylor1stComm What type of data is stored in the DaysLeft column of your table? Also, confirming that DaysLeft matches the text of the column in your table. If so, then I would recommend creating a brand new flow and toggling off the New Designer before you start editing. Since you've already edited your flow in the New Designer, it may have caused some issues. Better to start fresh. 

So, I'm getting somewhere! Switching to the classic view and adding "" around the number 145 in my condition action finally rendered a true return. 

 

Now...there's this 😫

rtaylor1stComm_5-1715296440913.png

 

 

I received the email from the final action/step but now I have a date formatting issue! ayi yi yi. This is where it all went wonky before. I'd reached out to help about the formatting and was told to place this expression in my email body : 

addDays('1899-12-30',items('For_each')?['Expires'],'dd MMM yyyy'). 

 

However, even though the expression was accepted, It caused the flow to fail

rtaylor1stComm_1-1715296252419.png

 

When I use the Dynamic Content from my 'Expires' column from the Excel Table, the flow runs, but gives me that full number date format from the first screenshot above. Here's the data I have in that column. So close to the finish line! 

rtaylor1stComm_4-1715296398751.png

 

 

 

@rtaylor1stComm As mentioned in my original post, it's a lot more efficient to filter out the items that you want to loop through using the filter query in the List Rows Present in a table action rather than looping through all rows and running a condition check as you have.

creativeopinion_0-1715306326877.png

I'd recommend using a filter query as it'll make your flow more efficient. 

 

Refer to the YT Tutorial linked below for details on how to use the addDays() function.

 

How to Work with 📆 Dates in Power Automate | Example Scenarios and Tips & Tricks

 

Are you easily stumped when working with Dates in Power Automate? In this Power Automate tutorial, I’ll show you how to compose an expression that will return a future date, a past date, how to count the number of days between two dates, how to check for a birthdate and anniversary date as well as tips and tricks when working with dates in Power Automate.

 

I’ll cover some common use cases and concepts that can help you to build better Power Automate flows. Feel free to skip ahead using the timestamps listed below. I’ve also linked a few other tutorials that you might be interested in as well.

 

IN THIS VIDEO:

 

 4 Date Functions You Need to Know

 How to use the Convert Time Zone Action

 How to Get a Future Date

 How to Get a Past Date

 How to Return SharePoint Items Due in a Number of Days

 How to Return SharePoint Items Due within a Date Range

 How to write a Filter Query for SharePoint Items Due in 30, 60 and 90 Days

 How to Calculate the Number of Days between Two Dates

 How to Check for a Birthdate and Anniversary Date

 How to work with Dates and Times in Excel

 How to use a Manual Trigger with Date Input

 How to Output Dynamic Text with an Expression

 How to Check if a Date Falls on a Weekend

 

Hope this helps!

If I helped you solve your problem—please mark my post as a solution .
Consider giving me a 👍 if you liked my response!

👉 Level up your Power Automate skills by checking out my tutorials on YouTube
👉 Tips and Tricks on TikTok and Instagram

 

Hi, Can you please try to convert the value to appropriate type like int. that may be creating issue in comparison. You can convert value using function int(). 

Thanks for this and I appreciate it; however, filter queries are not working for me and I'm kind of over trying that part, as I can't troubleshoot why my flows fail due to BadRequest when I use a filter query. But I will definitely take a look at the link regarding the addDays expression. 

 

thank you, 

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

Users online (676)