Set new values with conditions


I need a bit of help here.

I have a node with Priorities in numbers I want to convert in Low, Medium and High.

Priority: ‘1’ convert to ‘Low’
Priority: ‘2’ convert to ‘Medium’
Priority: ‘3’ convert to ‘High’

I know I need to do a combination of code functions, but it does not work:

Many thanks in advance


Hello, the node “switch” exist and can do that (I think)

1 Like

Yes, but I do not need to create 4 different routes… I will only have 1 result per priority
If I have “Priority” :2 then “Priority”:“Medium”

Thanks anyway for your time!

1 Like

Hi @Philippe, if you don’t want to go down the Switch node route suggested by @Dtneo, you could use code as well but it shouldn’t be necessary.

Here’s how it would look like using the switch approach from your workflow:

What I’ve done here was switching to the “Run Once for Each Item” mode, then replacing the item keyword from your example with $input.item.json as suggested in the example code used by the new Code node:


This is the result:

Hope this helps!

1 Like

Good evening @MutedJam,

Thanks for your answer I just see now. I finally managed by using a “ApplyMap” Node made by @BramKn.

I will look at the node you proposed anyway.

Many thanks



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.