cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
flavioPBadmin
Helper I
Helper I

Expression to Replace HIGH, LOW or MEDIUM with a number(1, 5, 9 respectively)

Expression to Replace HIGH, LOW or MEDIUM with a number(1, 5, 9 respectively)

Sorry for the somewhat newbie question, but I need to do some replacing as the title explains.

I know how to do a compose with:

 

replace(outputs('TaskValue'), 'MEDIUM', '5')

 

Which will output the 5 if the TaskValue is Medium, but what I need is to have it in the same output either of the three values (HIGH, MEDIUM, LOW) converted to 1, 5 or 9, so I can use the output of that compose to fill out a field down the Flow.

 

How can I achieve that? Grateful for any help provided.

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @flavioPBadmin,


Since this is only 3 values, I would go for the easiest option which is a nested replace functions in an expression.

 

 

replace(replace(replace(outputs('TaskValue'), 'MEDIUM', '5'), 'LOW', '9'), 'HIGH', '1')

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @flavioPBadmin,


Since this is only 3 values, I would go for the easiest option which is a nested replace functions in an expression.

 

 

replace(replace(replace(outputs('TaskValue'), 'MEDIUM', '5'), 'LOW', '9'), 'HIGH', '1')

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


flavioPBadmin
Helper I
Helper I

Thanks, that works for me!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,073)