web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PowerApps (V2) does no...
Power Automate
Answered

PowerApps (V2) does not pass on empty (optional) fields

(0) ShareShare
ReportReport
Posted on by 57

I am working on an app to automate adding/updating users contact information in MS 365 (with the Graph API).

Unfortunatly I encountered an issue to which I cannot think of a proper solution:

 

Since not all contact data (jobtitle,department,phonenumbers etc) need to be updated everytime, the fields in both the app and the PowerApps V2 trigger are optional.

The problem is that if a field is not populated it does not pass it on to the next steps, it just gets rid of it. No Empty field, no Null, no Blank just poof its gone. In the screenshot below you can see, there are 10 input fields, if only 5 are filled (or any other number) it does not pass on the other empty fields in the output:

KennethKok_0-1657291635230.png

As a result the HTTP step with the Graph API fails because there is no input, the exact error it gives is:

Unable to process template language expressions in action 'textNullCheck' inputs at line '0' and column '0': 'The template language expression 'if(empty(triggerBody()),null,triggerBody()['text'])' cannot be evaluated because property 'text' doesn't exist, available properties are 'text_1, text_4, text_6, text_10, text_11'. Please see https://aka.ms/logicexpressions for usage details.'.

 

Is there away i can alter the body of the HTTP request where it "bypasses" the fields if they are not there? Below is the body i have currently:

{
"jobTitle": "@{triggerBody()['text']}",
"department": "@{triggerBody()['text_1']}",
"officeLocation": "@{triggerBody()['text_2']}",
"businessPhones": [
"@{triggerBody()['text_3']}"
],
"mobilePhone": "@{triggerBody()['text_4']}",
"streetAddress": "@{triggerBody()['text_5']}",
"postalCode": "@{triggerBody()['text_8']}",
"city": "@{triggerBody()['text_6']}",
"state": "@{triggerBody()['text_7']}",
"country": "@{triggerBody()['text_9']}"
}

Categories:
I have the same question (0)
  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @KennethKok ,

     

    When some fields have null values, you can try adding question marks to avoid flow errors. 

    For example: "@{triggerBody()?['text']}"

     

    Best Regards,

    Levi

  • Verified answer
    KennethKok Profile Picture
    57 on at

    Thank you @v-liwei-msft for your reply.

    I actually found the full solution yesterday, which places a Null in the schema if a property is non existing or empty:

    Adding an IF equition to the expression.

    if(empty(triggerBody()?['text']),'Null',triggerbody()['text'])
     
    Result:
    {
      "jobTitle""Null",
      "department""XXXXX",
      "officeLocation""Null",
      "businessPhones": [
        "Null"
      ],
      "mobilePhone""+31XXXXXX",
      "streetAddress""Null",
      "postalCode""Null",
      "city""Null",
      "state""Null",
      "country""Null"
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard