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

Community site session details

Session Id : /Ts7fTPv041BpQdcHhD5ca
Power Automate - Building Flows
Answered

Compose different text depending on input value

Like (0) ShareShare
ReportReport
Posted on 27 Jul 2023 22:54:21 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.

I have the same question (0)
  • Roberto86 Profile Picture
    10 on 28 Jul 2023 at 00:04:45
    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 27 Jul 2023 at 23:41:27
    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 27 Jul 2023 at 23:04:18
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 786 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 724 Super User 2025 Season 2

#3
stampcoin Profile Picture

stampcoin 290 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete