Product: Mapping Manager
The @SWITCH() function will return the first Token that has a value. This function allows you to define a sequential series of Tokens to check, in which the first populated value will appear.
This can be useful when the data may not consistently show up in the same place, and you need to check multiple places to find the desired data.
@SWITCH()
@SWITCH(Token1,Token2,Token3,...)
Token 1: Token to use if value is present
Token 2: Token to use if Token 1 has no value
Token 3: Token to use if Token 2 has no value
...: Repeats pattern
Rules
Rule |
Tokens repeat indefinitely, allowing as many as needed to check |
Use Tokens straight - avoid Functions and calculations |
Hard Coded Values will always return - anything after a hard-coded value will never be evaluated |
Examples
Below are a series of examples of how you can utilize the @SWITCH() function effectively
Promotional Allowance Check
Checks the Item Level for a Promotional Allowance, if none present attempts to use the Header Level Promotion Allowance, otherwise returns empty.
@SWITCH([T:Items.Promotional Allowance],[T:Charges and Allowances.Promotional Allowance])
rev 7/3/2025
rev 7/3/2025