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 / Troubleshooting nested...
Power Automate
Answered

Troubleshooting nested or(if,if,if,if) expression

(0) ShareShare
ReportReport
Posted on by 87
I have the following or(if) expression:
 
or(
if(contains(outputs('Compose'), 'ANS'), 'e8...bd', ''),
if(contains(outputs('Compose'), 'SOL'), '9a...24', ''),
if(contains(outputs('Compose'), 'RD'), '4d...85', ''),
if(contains(outputs('Compose'), 'LD'), '60...14', ''),
if(contains(outputs('Compose'), 'Internt'), '99...fd', '')
)
 
Any of the single statments work without a problem, but if I wrap them in an or function with commas between, they fail with the following message: 

Unable to process template language expressions in action 'Post_studio_meeting' inputs at line '0' and column '0': 'The template language function 'or' expects all of its parameters to be booleans. Found invalid parameter types: 'String'.'.
 
I don't see any busted '' and the documentation on the Or function isn't helpful. Any advice?
 
 
Categories:
I have the same question (0)
  • Verified answer
    AndreasO Profile Picture
    87 on at
    Figured it out. Using OR was improper here since the IF conditions return values instead of true/false. Nesting the IF conditions instead worked. 
     
    if(contains(outputs('Compose'), 'ANS'), 'e8...bd', 
       if(contains(outputs('Compose'), 'SOL'), '9a...c24', 
          if(contains(outputs('Compose'), 'RD'), '4d...85', 
             if(contains(outputs('Compose'), 'LD'), '60...14', 
                if(contains(outputs('Compose'), 'Internt'), '99...fd', '')
             )
          )
       )
    )
     If anyone reading this is trying to figure out the logic here, look at the lack of a second , in the first IF statement. The syntax for an if statement is "if(logical test), result if true, result if false". In the above code, the next IF statement runs if the first logic test returns false. This can cascade indefinitely, but if you know one option is more likely than another, that should optimally be put first or early in the chain of If statements. 

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 286

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard