web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / On Error Write to exce...
Power Automate
Answered

On Error Write to excel with an SQL Query

(0) ShareShare
ReportReport
Posted on by 75

I am running a RPA that  opens a SQL connection and runs a SQL statement (based on two parameters that are already in an excel file), and then it writes the results on a specific excel column. My problem is that Im not going to be the person that fills the two parameters in the excel file, and I was trying to see what errors the RPA would return if one of these parameters were wrong. I was trying to use the "On Error" action, to go to the next action that is a "Increase a variable" if an error happens.

 

I changed the two parameters to something the SQL statement would never find in the database, and modify the action to "write to excel" to "On Error" to to next action, but the RPA still stops the flow because of this error:

 

carcmena99_0-1693494306387.png

 

This is my flow:

 

carcmena99_1-1693494400211.png

 

Write to Excel:

carcmena99_4-1693495946442.png

 

 

On error:

carcmena99_2-1693494436072.png

 

Query Result (After the SQL statement):

carcmena99_3-1693494491166.png

I want that if there is this error to go to the next action and continue with the flow.

 

 

I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Use an On block error action and put the relevant actions you want to handle inside the block. Then enable the "Handle unexpected logic errors" toggle in the parameters of the On block error action. This is the only way to handle the index out of range error.

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

     

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard