Hello, there’s an error with my contains expression on the switch activity.
This is my switch expression
If(paymentType.Contains("CASH "), "CASH “, If(paymentType.Contains(“SINGAPORE POST LIMITED”), “SINGAPORE POST LIMITED”, If(paymentType.Contains(“AXS”), “AXS”, If(paymentType.Contains(” CHEQUE "), " CHEQUE ", “Default”))))
This is the excel table where I am looking for the words that contains the specific words
Only two of the contains are working. Which are “SINGAPORE POST LIMITED” and “AXS”, “CASH” and “CHEQUE” are not working. I do not know why the other two is not able to work.
Hi,
I don’t think that switch will work with IF’s
Switch expression works as single value checker, so imagine that you are having variable “fruit” and this variable can have various values like “orange” or “apple” or “banana” etc… by swtich you are refering to variable: fruit and as a case you are using “orange”
This is new for me thanks for a lesson, ok so basically you can try this statement:
If(paymentType.Contains(“CASH”), “CASH“, If(paymentType.Contains(“SINGAPORE POST LIMITED”), “SINGAPORE POST LIMITED”, If(paymentType.Contains(“AXS”), “AXS”, If(paymentType.Contains(”CHEQUE”), “CHEQUE”, “Default”))))
Basicaly remove spaces while you are creating new value