cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

Condition Get Items to not send email when value is null

Hi all,

Need some help with the following please:

 

I have a Get Items action and i'm filtering a SPO list.

If it returns no items I do not want to send an email, I only want to send send an email when there are items from the Filter Query:

I'm unsure how to set the condition and what values i need to use to get this to work:

 

G99_0-1602513016411.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Memorable Member
Memorable Member

Hi @G99 

The way that I approach the condition to check if there are items in the SharePoint Get items action is as follows:

  • On the left of the condition, I use this expression to check if there are items: length(outputs('Get_items')?['body/value']) 
  • I then set the logical operator to is greater than 
  • And then I set the right of the condition to 0

If the condition is true, the flow will execute the Create HTML table and the Send an email actions. Please check out the attached screenshot and try it.

Regards,condition.png

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

2 REPLIES 2
Super User II
Super User II

@G99 

Hi there.  In your condition, put the empty() on the left side (be sure to use the value, though, rather than the body):

20201012A.PNG

 

And then on the right side, use true.  The empty statement will return 'true' if there is nothing in the value.

 

Give that a shot and keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Memorable Member
Memorable Member

Hi @G99 

The way that I approach the condition to check if there are items in the SharePoint Get items action is as follows:

  • On the left of the condition, I use this expression to check if there are items: length(outputs('Get_items')?['body/value']) 
  • I then set the logical operator to is greater than 
  • And then I set the right of the condition to 0

If the condition is true, the flow will execute the Create HTML table and the Send an email actions. Please check out the attached screenshot and try it.

Regards,condition.png

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (11,976)