cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

SharePoint people field returns null

Hello,

 

From a SharePoint task list, I am testing the field 'AssignedTo' for null.

 

But actually my condition @empty(triggerBody()?['AssignedTo']?['DisplayName']) is always true, even when tasks have a clearly identified Assigned to value.

 

Is there a way to test if the Assigned to field is empty that works?

 

Thanks beforehand -

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: SharePoint people field returns null

Hi @francoisperlade,

 

Could you please share a screenshot of your flow's configuration?

Further, do you want to check if the AssignedTo field of a SharePoint task list is empty?

 

I think there is something error with the formula that you provided within Condition box, the result that the "AssignedTo" field returned is an object array, there is no DisplayName property existed in the array directly, the DisplayName property only existed in the object item of the array:10.JPG

You could consider take a try to check if the DisplayName property of first object item of the array with the following formula:

@empty(triggerBody()?['AssignedTo'][0]?['DisplayName'])

 

If you want to check if the AssignedTo field is empty, you could consider take a try with the following workaround:

  • Add a "When an item is created" trigger.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
  • @empty(triggerBody()?['AssignedTo'])
    Within "If/yes" branch of Condition, add a "Send me an email notification" action.

Image reference:11.JPG

The flow works successfully as below:12.JPG

 

 

More details about how to check if a field is blank, please check the following article:

https://powerusers.microsoft.com/t5/Microsoft-Flow-Knowledge-Base/How-to-check-if-a-field-is-blank/t...

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: SharePoint people field returns null

Hi @francoisperlade,

 

Could you please share a screenshot of your flow's configuration?

Further, do you want to check if the AssignedTo field of a SharePoint task list is empty?

 

I think there is something error with the formula that you provided within Condition box, the result that the "AssignedTo" field returned is an object array, there is no DisplayName property existed in the array directly, the DisplayName property only existed in the object item of the array:10.JPG

You could consider take a try to check if the DisplayName property of first object item of the array with the following formula:

@empty(triggerBody()?['AssignedTo'][0]?['DisplayName'])

 

If you want to check if the AssignedTo field is empty, you could consider take a try with the following workaround:

  • Add a "When an item is created" trigger.
  • Add a Condition, click "Edit in advanced mode", type the following formula:
  • @empty(triggerBody()?['AssignedTo'])
    Within "If/yes" branch of Condition, add a "Send me an email notification" action.

Image reference:11.JPG

The flow works successfully as below:12.JPG

 

 

More details about how to check if a field is blank, please check the following article:

https://powerusers.microsoft.com/t5/Microsoft-Flow-Knowledge-Base/How-to-check-if-a-field-is-blank/t...

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (9,423)