Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

conditional setvalue expressions? IF, IIF

g5spark
Level 4
Level 4

i have a workbench workflow and i want to do the following:

if (/xpath/field = 'Y')

set target to 1

else

set target to 0

is it possible?

Location: A

Expression: if (/xpath/field = 'Y'), 1:0

1 Reply
Mark_Lindberg
Level 5
Level 5

The way to accomplish this is with conditional routes. Optionally going to one set-value or the other depending on your condition(s).

Be sure to set the route evaluation on the upstream service to check the conditional route before the default route.

Best practice is to always have one un-conditional route defined, and have it listed last in the evaluation sequence.

HTH

Mark

846391_pastedImage_0.png