cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sree_Roy
Frequent Visitor

How to handle error from a flow when there is no data match

Hello Community,

 

My PVA bot is asking user for a number type input from user, then calling a flow to read a spreadsheet with 2 columns:

  1. Number column with stored numbers.
  2. Date column with corresponding dates.

The flow is using Excel Online "Get a row" action to match to the 1st column. If value is matched, it is returning the corresponding date value to PVA. All good so far.

Sree_Roy_0-1640956813235.png

Where I'm running in to problem is if the user input is a value that doesn't exist in the 1st column. PVA returns the following error:-

 

Sorry, the bot can't talk for a while. It's something the bot's owner needs to address. Error code: 2003. Conversation ID: IFGLv8jC2We8EHd4kDwbKV-us. Time (UTC): 12/31/2021 1:21:50 PM.There's a problem with in . Please check your content.

 

The failed flow run shows error that "No row was found with Id '123456'"

 

I tried Conditions, but no luck. Then I tried to set variables and scope like this.

Sree_Roy_1-1640957672451.png

 

The successful path works, but I run in to schema errors as soon as I introduce the unsuccessful path (picture below doesn't work). I can't even save the flow. I also tried just sending value to PVA without the Success/Fail scope, but same error.

 

Sree_Roy_2-1640957932182.pngSree_Roy_3-1640958100547.png

 

Any suggestions how to catch "not found" error and handle it so that I can send a message back to PVA and ask the user to provide a valid entry? Thanks in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

You'll need to wait to return your results after exiting the Run After Success and Fail blocks.  Just use one return value with a text message.  Set a String Variable where you Return the values now, then use that in the Return.  Make sure the Run After is set for both Success and Skipped.  Use a Condition in the Bot to decide if it was an error or a valid response and act accordingly.

image.png



-------------------------------------------------------------------------
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

As I mentioned you need to set the Run After settings on the Return to both Success and Skipped.  If the flow goes down the error path then the success path will be Skipped.  If the following action isn't set to run on Skipped it won't fire.

image.png



-------------------------------------------------------------------------
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

6 REPLIES 6
Pstork1
Dual Super User
Dual Super User

You'll need to wait to return your results after exiting the Run After Success and Fail blocks.  Just use one return value with a text message.  Set a String Variable where you Return the values now, then use that in the Return.  Make sure the Run After is set for both Success and Skipped.  Use a Condition in the Bot to decide if it was an error or a valid response and act accordingly.

image.png



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

The Success (your value is this) and Fail (could not find/invalid entry) messages are different. How do I present the right message with one variable?

Both are being returned as strings.  Replace the returns you are currently using with a Set Variable action and build the return string. I would add something like 'Error:' to the front of the error message. Then return that string as a single return value. Once the bot gets it have the bot check the return to see if its a value or an error and proceed accordingly.

 

Or you could just return two strings. One for the value and one for the error and proceed based on which one is null.

 

Either way you can only have one Return action in the flow.



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

Thanks for your help @Pstork1 . I've modified as you suggested and now my flow looks like this:

Sree_Roy_0-1640961369308.png

Sree_Roy_1-1640961436573.png

 

Sree_Roy_2-1640961468549.png

I think I made progress - looks like I'm able to catch the "not found" condition and setting the variable to return null. Now the last hurdle (I hope) - don't know why PVA step is skipping.

As I mentioned you need to set the Run After settings on the Return to both Success and Skipped.  If the flow goes down the error path then the success path will be Skipped.  If the following action isn't set to run on Skipped it won't fire.

image.png



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

That did it. I really appreciate your help @Pstork1. Have a happy new year.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,644)