Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Compose different text depending on input value

(0) ShareShare
ReportReport
Posted on by 10

Hello, I am trying to compose a piece of text that changes depending on the input value.

 

My flow can return one of 7 different inputs and I would then like to output a different piece of text depending on which of the 7 inputs have been generated.

 

I have created an expression that works in excel:

=IF(A3=13571,"Projects",IF(A3=13570,"Reliability",IF(A3=13569,"Cost Down",IF(A3=13568,"Certification",IF(A3=14657,"EOL",IF(A3=16656,"Support",IF(A3=13737,"Supplier Change")))))))

 

But when I try transfer it into an expression in automate, it will not accept it:

IF(outputs('Compose_-_Inititive')=13571,"Projects",IF(outputs('Compose_-_Inititive')=13570,"Reliability",IF(outputs('Compose_-_Inititive')=13569,"Cost Down",IF(outputs('Compose_-_Inititive')=13568,"Certification",IF(outputs('Compose_-_Inititive')=14657,"EOL",IF(outputs('Compose_-_Inititive')=16656,"Support",IF(outputs('Compose_-_Inititive')=13737,"Supplier Change")))))))

 

I have found a work around, which is to string a load of true / false controls together but I cant help but feel that there should be more elegant way of doing this.

 

 Any help would be much appreciated.

  • Roberto86 Profile Picture
    10 on at
    Re: Compose different text depending on input value

    Sorry! I have found my mistake!


    This has now worked:

     

    IF(equals(outputs('Compose_-_Inititive'),13571),'Projects',
    IF(equals(outputs('Compose_-_Inititive'),13570),'Reliability',
    IF(equals(outputs('Compose_-_Inititive'),13569),'Cost Down',
    IF(equals(outputs('Compose_-_Inititive'),13568),'Certification',
    IF(equals(outputs('Compose_-_Inititive'),14657),'EOL',
    IF(equals(outputs('Compose_-_Inititive'),16656),'Support',
    IF(equals(outputs('Compose_-_Inititive'),13737),'Supplier Change','Other')))))))


    Thanks again abm!

  • Roberto86 Profile Picture
    10 on at
    Re: Compose different text depending on input value

    Thank you very much for your response abm,

     

    I have updated my expression to the this which the expression tool will now accept:

     

    IF(equals(outputs('Compose_-_Inititive'),'13571'),'Projects',
    IF(equals(outputs('Compose_-_Inititive'),'13570'),'Reliability',
    IF(equals(outputs('Compose_-_Inititive'),'13569'),'Cost Down',
    IF(equals(outputs('Compose_-_Inititive'),'13568'),'Certification',
    IF(equals(outputs('Compose_-_Inititive'),'14657'),'EOL',
    IF(equals(outputs('Compose_-_Inititive'),'16656'),'Support',
    IF(equals(outputs('Compose_-_Inititive'),'13737'),'Supplier Change','Other')))))))

     

    But something is still not quite right. The compose is seeing the input as "Other".  I'm not sure what I've done wrong.

     

    FLow.png

  • Verified answer
    abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: Compose different text depending on input value

    Hi @Roberto86 

     

    In PowerAutomate IF expression to compare equal is something like this.

     

    if(equals(50,100),'Equals','Not Equals')

     

    Thanks

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1