cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bchager
Helper II
Helper II

Flow worked as expected, but viewed as a failure.

Hello all...

 

Is there a way to configure a Flow so when only one condition is met, it's still viewed as a successful run and not a failure? Given the data used during a run today, I would not expect any conditions to be met for the "Yes" branch to run, but that's OK.

 

bchager_0-1603297380925.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

If you look at the compose you can see that for the particular record being checked the value you are trying to cast to an INT is blank.  That is why the INT() is failing.  You'll need to look into the data and figure out why that particular entry is being read as blank or add an additional condition to the No dialog to do nothing if the value is blank.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

16 REPLIES 16
Pstork1
Dual Super User III
Dual Super User III

The action you've circled isn't the problem.  Its another instance in the loop.  Click on the Next Failed link to get to the loop that failed and see what went wrong.  The fact that the yes side didn't run is not a failure.  Something else in one of the loops is broken.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks, @Pstork1 

 

Here's the error. I suspect it has something to do with the date expression I'm using for 4 columns in the Excel table that is being used with this flow. I don't know why there'd be 149 fails though. There are only 22 rows of data with 63 dates. The expression I'm using to format dates is immediately below the error. Any thoughts?

 

Capture.JPG

 

formatDateTime(addDays('1900-01-01',add(int(items('Apply_to_each')?['Date 1']),-2)),'yyyy-MM-dd')

Pstork1
Dual Super User III
Dual Super User III

You aren't getting 149 fails, you are getting 149 loops.  The 23rd loop is the first one to fail.  If there are only 22 rows of data then I would take a look at what the Apply to each is processing.  because it thinks there are 149 of them.  In terms of what is going wrong, I suspect one of your values coming from Excel is a whole number not an integer.  This is a common issue. In most programming languages doing something equivlent to int(1.5) would result in a 1.  In Flow its an error.  The value being cast to an int has to be a whole number with no decimal.  You can troubleshoot that by putting a compose just before the condition and setting it to 

items('Apply_to_each')?['Date 1']

That will show you the value throwing the error. 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks, @Pstork1  but it's still a mystery to me. I did add the Compose before the Condition as you suggested, but the value throwing the error isn't jumping out at me. I just see the "InvalidTemplate" error I noted before as I scroll through the loops. 

 

I double checked the source Excel table compared to the Flow output and the data in all columns matches.

Pstork1
Dual Super User III
Dual Super User III

Can you show me a screenshot of the compose results on the loop where the error is being thrown?  What is the value of 'Date 1'



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1  Thanks for your help here but the only messages I see are the No Dependent Actions Succeeded and the Template error I posted before. I don't see any compose results on the loop where the error is being thrown.

Pstork1
Dual Super User III
Dual Super User III

Did you add a compose step above the condition as I recommended set to 

items('Apply_to_each')?['Date 1']

If you did then you can see what the value of the item is that you are trying to put into the INT() function.  That is where your error is coming from on the 23rd loop.  We need to look at that value to figure out why INT() isn't working.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1  Yes, I created the Compose step and this is what I see:

 

bchager_0-1603397768135.png

This is what I see, and would expect to see given the input data, in the subsequent steps:

Capture.JPG

 

After configuring the Compose step to run after "is successful" and "is skipped," the Flow returns successful runs as opposed to failing before. Do you know why? It looks like it is handling a false negative.

If it continues to work this way, I am good!  

Pstork1
Dual Super User III
Dual Super User III

It will probably work, but that's not the fix and not where the Compose should be placed.  The Compose needs to be inside the loop just before the condition so you can see what the value is that is causing the INT() to fail inside the loop.  You also need to be in the loop that actually failed rather than a successful one.  The original error suggested that you were trying to cast a non-integer value to an integer.  The compose will help you figure out what value you are getting and why it can't cast to an int.

image.png

The reason its running after you set Run After is because you now have a step to run when it fails, so its no longer reporting the error because you are handling it.  But you aren't handling it you are just ignoring it.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
bchager
Helper II
Helper II

@Pstork1  Thank you. I am not seeing how to put a Compose inside the loop before the condition. All I saw was a + sign between List rows present in a table and Apply to each, so I placed it there.

Your thoughts?

Pstork1
Dual Super User III
Dual Super User III

Add it inside the loop after the condition.  Sometimes its hard to insert it at the top.  Then drag and drop the condition below it after you create it.  But keep it inside the loop and before the condition.  If its outside the loop you won't be able to see the value you need and if its after the condition you'll never get to it because of the error.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1 I appreciate your hanging in there with this. I was able to insert the Compose step where you suggested and I tried using different inputs like what you see highlighted below, and Extract Date, but I'm not finding additional detail when I scroll through the failed iterations.

 

Capture.JPG

 

Capture2.JPG

Pstork1
Dual Super User III
Dual Super User III

When you set the value of the compose you have to use the dynamic content or Expressions tab to set the value.  Right now you are just inputting a constant string with the JSON we want to look at.  The compose entry should look the same as the left side of the condition.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

I believe it's set up as you suggested now. 

 

Capture.JPG

 

Capture2.JPG

Pstork1
Dual Super User III
Dual Super User III

If you look at the compose you can see that for the particular record being checked the value you are trying to cast to an INT is blank.  That is why the INT() is failing.  You'll need to look into the data and figure out why that particular entry is being read as blank or add an additional condition to the No dialog to do nothing if the value is blank.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

@Pstork1  Thank you. You've been a big help!

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (31,533)