Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

What is the expression or input array that I can use for empty fields in manually triggered flows

(0) ShareShare
ReportReport
Posted on by 164

I have an manually triggered flow.  

SharonS_1-1719696109862.png

 

This is the error message:

Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'The template language function 'if' expects three parameter: the condition to test as the first parameter, the value to return if the condition is true as the second parameter, and the value to return if the condition is false as the third parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#if for usage details.'.

 

 

 

The expression is

if(empty(triggerBody()['text_1'],'  ',triggerBody()['text_1']))

 

the condition to test as the first parameter:      if(empty(triggerBody()['text_1']

the value to return if the condition is true:       '  '

value to return if the condition is false:              triggerBody()['text_1']

 

What went wrong?

Categories:
  • FLMike Profile Picture
    FLMike 31,242 on at
    Re: What is the expression or input array that I can use for empty fields in manually triggered flows

    HI @SharonS 

     

    You can also put the ? there so triggerBody()?[xxxx]

     


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • SharonS Profile Picture
    SharonS 164 on at
    Re: What is the expression or input array that I can use for empty fields in manually triggered flows

    Hi @FLMike  

    I changed the expression and 

    received this error message.   Note I left the Text field blank in the test run.  When I put text in the field, it ran successfully.

     

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

  • FLMike Profile Picture
    FLMike 31,242 on at
    Re: What is the expression or input array that I can use for empty fields in manually triggered flows

    Hi @SharonS 

     

    If you break down your code it actually is like this

     

    if(
    empty(triggerBody()['text_1'],
    ' ',
    triggerBody()['text_1']
    )
    )
    
    but should be like this
    if(
    empty(triggerBody()['text_1']),
    ' ',
    triggerBody()['text_1']
    )
    
    

     

     

    you have the paran to CLOSE the empty check at the END not at the END of the empty check itself, so the if statement looks like it gets one input instead of the correct format.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard