Forum Discussion

DogAndPonyShow's avatar
DogAndPonyShow
Copper Contributor
Mar 16, 2021

Reminder emails (Power Automate) - dealing with blank people field

 

Hi there,

 

I hope you can help.

 

In Power Automate I want to check for blank email values in a people SharePoint column.

 

Design solution:

 

I have a flow which sends emails 4 days before a target date as reminders.  The datasource is a SharePoint Online list.

 

On the list, TargetCompletionDate is a Date/Time column showing date only in a standard format. Owner is a person/group column, allowing selection of 'People and Groups'.  It's this value used to send an e-mail for items nearing their completion date.

 

  • On the Get Items action, there's a filter query: TargetCompletionDate ne null to filter out items with blank 'TargetCompletionDate' values, so the flow doesn't error on those items.
  • A condition uses the 'addDays' function adding 4 days from now & checks against the 'TargetCompletionDate' value (see screenshot Reminder Flow 3).

  • If that condition is met there's a second condition to only send emails if the 'Owner' value isn't blank (screenshot Reminder Flow 4).  If there's an email address, it sends the reminder email.

Question: is there a better way to check for empty email values?

 

Instead of a condition, can I use a Trigger Condition or an addition to the Filter Query.

 

I've tried a few things, but with no success.

 

Trigger Conditions I've tried:

@not(empty(triggerBody()?['Owner']))
@not(empty(triggerBody()?['Owner/EMail']))
@not(equals(triggerBody()?['Owner'],null))
@not(equals(triggerBody()?['Owner/EMail'],null))

 

If I strip out the existing Filter Query, I can get it to work with Owner ne null -- however I'll need to check TargetCompletionDate isn't empty, otherwise the flow will error on items where it is.  I'm not getting the syntax right.

For instance, this isn't working: TargetCompletionDate ne null or Owner/EMail ne null

 

(I suspect this is because there will always be a ; (semi-colon) in the TO: field, using the Send an email notification (V3) action)

 

Can anyone suggest alternatives to the second condition action?

 

Thanks!

No RepliesBe the first to reply

Resources