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,721 Super User 2026 Season 2 on at

    Adress it with item()['CMTYPE']

  • Chriddle Profile Picture
    8,721 Super User 2026 Season 2 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

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 248 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 160 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 142 Super User 2026 Season 2

Last 30 days Overall leaderboard