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
Power Participant
Power Participant

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
Power Participant
Power Participant

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

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
Power Participant
Power Participant

Nice one! 🙂

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,434)