Forum Discussion

cprothero's avatar
cprothero
Iron Contributor
Apr 27, 2018

Dealing with empty Person fields in Flow

I am trying to build a flow connected to a SharePoint list with a few person fields. However if I try to access any of the person fields and they are blank, it chokes. I even get an error if I try to test the field for null or empty. I'm not sure how to proceed. These are not required fields. 

 

The error I get is something along the lines of:

 

The template language expression 'triggerBody()?['PersonField']['DisplayName']' cannot be evaluated because property 'DisplayName' cannot be selected.

 

Doesn't seem to matter which field I'm trying to get: Claims, DisplayName, Email, etc 

2 Replies

    • cprothero's avatar
      cprothero
      Iron Contributor

      Thanks for the quick answer.This helped me clarify things a little. In case it helps anyone else, here's what I had to do.

       

      Initialize variables for each field (no value). 

      Try a condition against each person field, testing the Object field itself (not Claims, DisplayName, etc) for null. 

      Then if it wasn't null, I could assign the right value to the variable. 

       

      I think my problem was that I was testing my conditionals against a value in the object, not the object itself.

       

      Thanks again. 

       

       

Resources