cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AntoinetteB
Helper III
Helper III

Need to create Filter Query based Error Message Email and Cancel Flow

I'm completely stumped on how to create an error message.  First off, this is working correctly with no errors.  I am running a flow on a List Item, and then I'm finding a single Doc Library File that matches that List Item Title, and then pulling the file properties for only that particular file.  Next I use the Value from the Doc Library File Properties in an apply to each to pull the ID for the Library File with the name that matches my List Item, and use that ID to update that files properties in that separate Doc Library.  Success.

AntoinetteB_3-1631814170842.png

Okay.  So where I'm stumped is that if there is NOT a FileLeafReq in the Document  Library with a name  IDENTICAL to my List Item Title, I want to generate an error email and cancel the entire flow.  But when this is the case, the Get Files action just doesn't return anything at all.  It doesn't fail or skip.  So my value apply to each containers do run, but ignore anything inside since no file properties were returned.  I cannot figure out how to code <If Get files (properties only) Filter Query FileLeafReq ne 'Title.xlsm' then cancel my flow, don't run any other actions, and send an error message email.>  I have tried to use the Configure Run After, but it doesn't count anything as skipped or failed because it DOES run the apply to each container.  Help? 

(Below are screen shots of what happens when there is no FileLeafReq in the Doc Library to match the item Title in the List)

AntoinetteB_1-1631815055324.png

 

AntoinetteB_2-1631814094712.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

@AntoinetteB 

To send an email when no items are returned, see my example below:

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.

Scott

View solution in original post

2 REPLIES 2
ScottShearer
Super User
Super User

@AntoinetteB 

To send an email when no items are returned, see my example below:

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.

Scott

Victory!  Worked perfectly, TYVM.  I use variables but only when I have an exact example of how to code them, and this is my first time creating flows from Lists and Attachments instead of Libraries so the learning curve has been a bit steep on this one.

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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!

Top Solution Authors
Top Kudoed Authors
Users online (8,173)