I am trying to perform a simple calculation in Virtual2 (a calculated field) using a value selected in a multi select dropdown. However, the calculation is failing.
Step 1 - I set up a multi select dropdown - List_String
Step 2 - the multi select dropdown field ID cannot be used in a CASE statement therefore I set up [@Virtual1] to capture the selection in the List_String using JavaScript
Step 3 - I then tried some CASE statements in [@Virtual2] to perform a simple calculation based on the List_String selection copied to [@Virtual1]. However, this part isn’t working. I have tried this formula:
CASE
WHEN '[@cbParamVirtual1]' LIKE '%'+'Car'+'%' THEN 300
END
The above formula works with any other field (dropdown, radio buttons, etc) but it will not work with [@cbParamVirtual1]. I wonder if it is because of the data type (when copied from the multi select dropdown) and whether my formula needs to CAST [@cbParamVirtual1] as something that Caspio will recognise as text.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
JKSGT
Hi,
I am trying to perform a simple calculation in Virtual2 (a calculated field) using a value selected in a multi select dropdown. However, the calculation is failing.
Step 1 - I set up a multi select dropdown - List_String
Step 2 - the multi select dropdown field ID cannot be used in a CASE statement therefore I set up [@Virtual1] to capture the selection in the List_String using JavaScript
Step 3 - I then tried some CASE statements in [@Virtual2] to perform a simple calculation based on the List_String selection copied to [@Virtual1]. However, this part isn’t working. I have tried this formula:
CASE
WHEN '[@cbParamVirtual1]' LIKE '%'+'Car'+'%' THEN 300
END
The above formula works with any other field (dropdown, radio buttons, etc) but it will not work with [@cbParamVirtual1]. I wonder if it is because of the data type (when copied from the multi select dropdown) and whether my formula needs to CAST [@cbParamVirtual1] as something that Caspio will recognise as text.
Would anyone have any recommendation?
Many thanks
Jay
Many thanks
Jana
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.