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 Automate
Unanswered

Data Mapping via Flow

(0) ShareShare
ReportReport
Posted on by 6

I would like map values in several attributes, for example

 

0 : Critical

1 : High

2 : Medium

3 : Low

 

From the trigger, I receive this JSON structure

{

   "priority":1

}

and in the flow, I would to transform in

 

{

"priority":"High"

}

 

How I can do this with Flow?

 

Thanks / Philippe

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

    Hi PValette,

     

    You may try to use workflow definition language to replace a string with a given string.


    Please check the documentation at here:
    https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language


    For a simple test, I use the following function in a Compose action:
    if(equals(triggerBody()['text'],'0'),replace(triggerBody()['text'],'0','Critical'),'')


    Hope this could be a reference for you.


    Best regards,
    Mabel Mao

  • Hugo_baltech Profile Picture
    3 on at

    One way to achieve something similar to a hash table in power automate is to use the *Select* data operation and then access it under 'expressions' like so:

    Hugo_baltech_0-1661107473068.png

     

    Hugo_baltech_1-1661107629452.png

    Hugo_baltech_2-1661107660513.png

    Where the 'Body' variable is given as 'body('Select')[0][string(body('Parse_JSON_-_input')?['priority'])]'.

    Running in the following order:

    Hugo_baltech_3-1661107701374.png

     

     

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Example:

    2022-08-21_20-01-07.png

    Expression in Compose 2:

    concat(
     if(equals(outputs('compose')['priority'],0), 'Critical', ''),
     if(equals(outputs('compose')['priority'],1), 'High', ''),
     if(equals(outputs('compose')['priority'],2), 'Medium', ''),
     if(equals(outputs('compose')['priority'],3), 'Low', '')
    )

    Blog: tachytelic.net

    YouTube: https://www.youtube.com/c/PaulieM/videos

    If I answered your question, please accept it as a solution 😘

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