cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to retrieve a SharePoint Flow step error message

Hi

When a certain step on a flow fails, I would like to have the option to send an email notifying me of the error.

Here is an example:

If 'Create item' fails I want to retrieve the error message.Message error.png

I tried to  retrieve the message with body('Create_item)['message'].

However, this is not correct, it's not working and I get an error saying:

 

Unable to process model language expressions in action "Send_an_email_5" entries in line "1" and in "1942" column: "Unable to evaluate model language expression" body ('Create_item') ['message' ], "because the" message "property does not exist. The available properties are" ItemId, Id, Name, DisplayName, Path, LastModified, Size, MediaType, IsFolder, ETag, FileLocator, LastModifiedBy. "See https://aka.ms / logicexpressions for usage details. "

 

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Hi!

This is how I solved the issue:

I initialized a variable named Message (before the condition where Create item is hosted, as you cannot initialize variables inside conditions). Then I set the variable to body(Create_item)?['Message'], after 'Create item'.

Now I can retrieve the message to be sent through email.Initialize Variable 2.png

 

 

View solution in original post

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @Anonymous ,

 

Do you want to retrieve error message when an action failed?

 

Currently, we could configure run-after to send out a notification when a step failed, however, it is not possible to retrieve the error message from the failed step using flow.

 

Please feel free submit a request at Flow Ideas Forum, I will suggest other customers who have the same request vote your idea at here:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi!

This is how I solved the issue:

I initialized a variable named Message (before the condition where Create item is hosted, as you cannot initialize variables inside conditions). Then I set the variable to body(Create_item)?['Message'], after 'Create item'.

Now I can retrieve the message to be sent through email.Initialize Variable 2.png

 

 

Helpful resources

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

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,526)