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 / Replace a number in a ...
Power Automate
Unanswered

Replace a number in a field with a Text Value.

(0) ShareShare
ReportReport
Posted on by

I'm setting up an export in power automate for users (will run from canvas app) and in one of the fields I ideally would like to show them a text value instead of the number that is in the field.  The number relates either to a customer type and the text value is not contained in the table anywhere.  Can I hardcode this into Automate with an IF statement or something?  I've tried a few things but keep getting the 'statement is invalid'!

 

eg:  the field 'Category Code' - CMTYPE has a value of 0-5.  In my canvas app I use the following formula to display the text the user is expecting:

If(ThisItem.CMTYPE="0","Corporate",If(ThisItem.CMTYPE="1","Green Grass",If(ThisItem.CMTYPE="2","Off Course",If(ThisItem.CMTYPE="E","International",If(ThisItem.CMTYPE="3","Sporting Goods",If(ThisItem.CMTYPE="4","Driving Range",If(ThisItem.CMTYPE="5","Other",ThisItem.CMTYPE)))))))

 

rowan_preston_1-1700431142782.png

 

Appreciate any help.

 

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @rowan_preston ,

     

    Please try:

     

    If(
     equals(ThisItem.CMTYPE,'0'),
     'Corporate',
     If(
     equals(ThisItem.CMTYPE,'1'),
     'Green Grass',
     If(
     equlas(ThisItem.CMTYPE,'2'),
     'Off Course',
    .....

     

    Best Regards,

    Bof

  • Chriddle Profile Picture
    8,674 Super User 2026 Season 1 on at

    Adress it with item()['CMTYPE']

  • Chriddle Profile Picture
    8,674 Super User 2026 Season 1 on at

    You may also consider to change the nested IFs to an object like this:

    {
    "0": "Corporate",
    "1": "Green Grass",
    "2": "Off Course",
    "E": "International"
    }

    and use this with following expression:

    coalesce(outputs('Compose')?[item()['CMTYPE']], item()['CMTYPE'])

     

    Example flow:

    Chriddle_0-1700476287058.png

    Since this example flow only loops over the CMTYPE's values, the expression look a bit different:

    coalesce(outputs('Compose')?[item()], item())

    Chriddle_1-1700476413327.png

     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 612

#2
Valantis Profile Picture

Valantis 344

#3
11manish Profile Picture

11manish 326

Last 30 days Overall leaderboard