Error / Exception Handling in Power Automate | Scope | Try Catch Finally in Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
guys today we are going to see how to handle the errors in power Atomic so for this I have created one SharePoint list with this dummy column title description and project number and now we are going to create a new instant Cloud flow so I will give the flow name as an error handling and let's say we'll take manual triggered flow so uh error handling in power Atomic is the same like other programming language like try catch and finally block so same concept we are going to use here uh so uh the try catch is nothing but a scope action so we are using scope action for all try catch and finally block so what I will do first I will write write rename this to the then again I will add one more scope action and I will rename it as a catch and The Last Action scope action and I will rename it as a finally okay so what will happen whatever the actions of your workflow you will write in the try suppose any of the action in the try get fails then we are calling the catch otherwise this action will not run and finally will always run so how we can do that so first what I will do I will create a one a variable variable so I I am going to initialize the variable V error okay and the type is Boolean and I am setting it as a false initially it will be a false so once error occurred in this try block we will convert we will cite it as a true okay so in try block let's say we add a get item get item action so same uh the SharePoint list we will use in this site SPF excite so spfx this is our list name and we will write one filter query so this is the project number we will filter it out to this project number so I can write project number equals to equals to 1 0 1 so it will return here two records and I will I will add a random compose action and in this composition I will just I will just read the title from this get item so now in try block we have a two action any one action if get fails then catch should catch should be run so so how first I will write the uh I will write the variable or I will set the variable to the true in catch action so I'm writing I'm setting the variable V error to the true okay so I'm setting this action and what one more thing we will do we will write one more compose action and we will read the error whatever the error is there so I can rename here read error so here you can write expression as a result of try block okay so now we will get error here and in finally we will check if this catch get executed and if the error V error V error a variable gets true then send an email or send a notification okay okay so so I will write the compose action here sorry I will write the condition here in this condition I will check V error if V error is equals to true 10 we can write you can write the send an email notification so for now for me I will just just send a notification on on the teams okay post message post message in a chat or Channel okay here I will select as a group chat and we have daily standup okay so here here what I will do I will just just give the output of this error this read error okay so what I will write reader this output I will post it here if if it will get it will not get error simply it will goes to the no Loop so I am going to save the workflow and we'll test before that there is a two settings for catch block and finally block so in catch block if If the previous step all the track try block has error then only cat should execute so we have to go here configure run after and just remove this one select these three has field it's skipped and has timer so catch will run if any action in the track get fails and finally anyway it will run in all the conditions so so these uh don't forget to make these changes and now you can save your workflow and just test it so so now it will run successfully because we haven't made any mistake you will not get anything see this catch is skipped why it is keep because we don't get any error in this block and also we will not get any message here so what we will do and finally we can check this condition get false and it will do nothing so what we will do we will make we will update any action this action and we will write something here and we will save so now try will get failed and this variable becomes true so it will go in catch and then in finally you will get the notification that your your workflow got failed so we are testing this run flow 10. see you can see here the try log got filled but finally we have we have a we have data setting so so it will show as a successfully and if you see here you got the error message you can find here by writing the error error this is the error message you got so if you see here you will see a condition got true and this this action is executed so in this way you can we can handle the errors in power atomic
Info
Channel: Praksys IT
Views: 529
Rating: undefined out of 5
Keywords: #PowerAutomate, #Error Handling in Power Automate, Power Automate and get error message on Email or Teams, Try Catch Finally
Id: IvuSXvoPxrk
Channel Id: undefined
Length: 9min 33sec (573 seconds)
Published: Mon Mar 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.