cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AntoinetteB
Advocate II
Advocate II

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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,610)