Data Transformation Builder Select case statement
Using the Data Transformation Builder I see the action if but in my scenario a case statement would be better. Is there anyway to do a case statement? This way I dont need to build a long if else logic.
Comments
If you just need to get an output value based on different input values, a lookup table would be the best option.
If you actually need to execute completely different logic depending on the input value, then you can consider using code actions to add a series of ElseIfs, which are much easier to read than deeply nested if blocks.
Thanks, Are you able to have multiple conditions?
if ReceivingFacility="A" or ReceivingFacility="B" or ReceivingFacility="C" {
Yes, you just need to wrap them in parentheses and use "||" for "or":
if ((ReceivingFacility="A") || (ReceivingFacility="B") || (ReceivingFacility="C")) {
Or look at using other functions like $LISTFIND or the "[" (contains) operator:
if ($LISTFIND($LISTBUILD("A","B","C"), ReceivingFacility) {