cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tkat
New Member

Condition is triggering only one set of actions

I am so grateful to this community as I've learned to successfully execute flows over the past couple of weeks! But, I now need help that I cannot find via searching. 

 

Situation

I've built a flow that grabs items from a SharePoint List based on the date the List item was created. If no List Items were created in the past seven days, I want to send an email stating that. If there are List Items created in the past seven days, I want to send an email with a table of those Items. 

Background

I have a flow without conditions that works perfectly to send the table; I included a note in the email stating "If the below table is empty, there were no new items submitted over the past seven days." But, I want to do something more elegant than sending a blank table. 😬

Issue

With the "is equal to" condition, the below flow sends only the email in the If no section, regardless of whether there are any List Items that meet the seven-day criteria. If I change the condition to "is not equal to," it sends only the email in the If yes section (but without the table since those actions are intentionally excluded). I did not use Apply to each because I included only one value that checks to see if there is data from the Get items step. Advice is appreciated!

 

tkat_0-1634659124097.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
eliotcole
Super User
Super User

Change the 'value' side to length(outputs('Get_items')?['body/value'])) and put 0 in the right side, and let us know how that works out for you.

 

Essentially, that's counting how many entries it has, and if there's 0, then it sends the email on the yes side, if there's more, it lists them and sends that email!

View solution in original post

4 REPLIES 4
eliotcole
Super User
Super User

Change the 'value' side to length(outputs('Get_items')?['body/value'])) and put 0 in the right side, and let us know how that works out for you.

 

Essentially, that's counting how many entries it has, and if there's 0, then it sends the email on the yes side, if there's more, it lists them and sends that email!

ScottShearer
Super User
Super User

@tkat 

The solution proposed by @eliotcole should work for you.  Please note that you need to enter an expression on the left side rather than just entering text.

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

Thank you, @eliotcole for the quick reply and solution! It's working perfectly. 😁👍

eliotcole
Super User
Super User

Nice one! 🙂

 

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.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Users online (2,087)