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 / If statement expressio...
Power Automate
Answered

If statement expression with dynamic content

(0) ShareShare
ReportReport
Posted on by

I have Create Item to Sharepoint operation set pulling responses from a Form, I would like to populate data in this Create Item operation in a field titled "Deep Link" based off an If statement from another field titled "Request Type".

 

If Request Type equals "deactivate a course", then the Deep Link field should show nothing, just empty value. If "deactivate a course" is False, then the Deep Link field should show text "Deep Link".

 

After googling and reading posts here on the forum, this is what I've come up with but I know it's wrong. 

 

if(equals(outputs('Get_response_details')?['body/r47fb301111e74dc4b0abe7bd26b23e11']),deactivate a course), ' ', 'deep link')

 

Any help would be greatly appreciated!

 

Categories:
I have the same question (0)
  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @KellyHickman 

    Almost!

    You are simply missing single quotes around deactivate a course. It should be:

     

    if(
    	equals(
    		outputs('Get_response_details')?['body/r47fb301111e74dc4b0abe7bd26b23e11'],
    		'deactivate a course'
    	),
    	 '', 
    	'deep link'
    )

     

  • KellyHickman Profile Picture
    on at

    Thank you for responding, it's still telling me it's invalid expression 

    if(equals(outputs('Get_response_details')?['body/r47fb301111e74dc4b0abe7bd26b23e11']),'deactivate a course' ), '', 'deep link' )

    I'm adding it as an expression to the Deep Link field, it should work there, right? Or is my logic off?

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Where exactly are you putting this code?

  • KellyHickman Profile Picture
    on at

    I want the expression to go into this field. 

    KellyHickman_0-1709846121725.png

    So I either see nothing, no text,  in this field or the text "deep link".

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Is that a text field or multiple lines of plain text or rich text or something else?

  • KellyHickman Profile Picture
    on at

    The list settings from Sharepoint say Multiple Lines of Text.

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Can you add a compose before that create/edit action and add the formula expression:

    outputs('Get_response_details')?['body/r47fb301111e74dc4b0abe7bd26b23e11'])

     

    Then add a terminate action to stop the flow there

  • KellyHickman Profile Picture
    on at

    I appreciate your assistance! I've performed this step, created the Compose and Terminate directly after. Then I went back to the deep link field and entered this expression:

    if(equals(outputs('Compose'),'deactivate a course','','deep link'))
    It allowed the expression this time but when testing it returned error message:
    Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The template action 'Compose' at line '1' and column '6880' is not valid: "The template function 'outputs' is not expected at this location.".'.'.
  • KellyHickman Profile Picture
    on at

    I figured out my error on that InvalidTemplate issue above, but now I have a different one: 

    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.'.

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    It's because you were referencing the test code outputs('Compose') instead of 

     

     

     

    outputs('Get_response_details')?['body/r47fb301111e74dc4b0abe7bd26b23e11']

     

     

     

     

    So the next error is that an If statement requires 3 parameters


    Something to check/evaluate,
    What should happen if true
    What should happen if false

    Example:

     

     

     

    if(
     equals('one','two'), // Something to check: Does 'one' equal 'two'
     'yes - correct', // if true 
     'no - incorrect' // if false
    )

     

     

     

    According to the error message (The function was invoked with '1' parameter(s).), you have only provided 1 parameter e.g.

     

     

     

    if(
     equals('one','two') // Something to check: Does 'one' equal 'two'
    )​

     

     

     



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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 261 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 185

#3
Haque Profile Picture

Haque 168

Last 30 days Overall leaderboard