The
Derived column will return the result of the final statement to be parsed in the expression. When I tested this I got 1 or 0 in my derived column, signifying whether the
If statement resolved to True or False.
To get the desired result, you will need to assign the result of your
FormatString statements to a new variable, and write the name of that variable as a final statement, followed by a semicolon. For example:
if:(Mod(Id,2) = 1)
{
VARResult:= FormatString(CustomVariable1,"Image,Body");
}
else
{
VARResult:= FormatString(CustomVariable2,"Body,Image");
}
VARResult;
Notice that I've also placed the
Modulo expression inside the
If statement's condition? The effect is the same without needing to assign its result to a variable and then evaluate it. Feel free to follow this suggested change if the variable is not used elsewhere.
Edit: Updated code to include FormatString.