cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
faustocapellanj
Memorable Member
Memorable Member

Hi @Anonymous 

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
edgonzales
Super User
Super User

@Anonymous 

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.

faustocapellanj
Memorable Member
Memorable Member

Hi @Anonymous 

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!

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.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,498)