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

Notifications

Announcements

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
    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,436 Super User 2025 Season 2 on at

    Adress it with item()['CMTYPE']

  • Chriddle Profile Picture
    8,436 Super User 2025 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard