Multiple Choice in nested if formula
Help please - I have a multiple-choice and want to create text from it. When a region is selected it must form part of the text. But with the formula when the first selection is not chosen it does not show any of the other selections in the result. Also, none of the selections after a region that is not chosen does show.
'Note Price Export' := if 'Note Price' = true then
if text(chosen('EVG Sales Regions')) = "UK" then
"The " + 'Marque Brand' + " " + 'WEV Model Name' + " sells in the UK from " + 'GB MSRP (before incentives & destination)' + ". "
end
else
if text(chosen('EVG Sales Regions')) = "USA" then
"The " + 'Marque Brand' + " " + 'WEV Model Name' + " sells in the USA from " + 'US MSRP (before incentives & destination)' + ". "
end + if text(chosen('EVG Sales Regions')) = "Europe" then
"The " + 'Marque Brand' + " " + 'WEV Model Name' + " sells in Europe from " + 'EU MSRP (before incentives & destination)' + ". "
end
end
11 replies
-
It looks like you should be using a Choice field instead of a Multiple Choice field since you are testing for only one of 8+ possible selections. You are missing an "else" after the "USA" test and before the "Europe" test, but I suggest you look at this thread for another possible solution...
-
Thanks, bad example - there could be more than one possibility so unfortunately, I have to go with multiple choice
-
I suppose it depends on what you choose to focus on. I would still use a switch statement, especially considering the quantity of possible choices.
-
I got a chance to look at what you posted on my computer instead of my phone. In the image I show what you have and below that a corrected version.
I would still use a switch statement though.
-
Where to write this formula?
-
If you are modifying a Field it would need to go in a Trigger or a Button
-
Thanks, Sean, I tried to get videos on switch statements but it seems it works with choice and not multiple-choice as required in this case.
-
Wynand, It will work with a switch statement. Below is a short example of all the possible choice combinations, just modify to suit your needs.
switch concat(chosen(Country)) do
case "Europe":
"Europe"
case "UK":
"UK"
case "USA":
"USA"
case "Canada":
"Canada"
case "Australia":
"Australia"
case "New Zealand":
"New Zealand"
case "China":
"China"
case "Norway":
"Norway"
case "Europe, UK":
"Europe & UK"
case "Europe, USA":
"Europe & USA"
case "Europe, Canada":
"Europe & Canada"
case "Europe, Australia":
"Europe & Australia"
case "Europe, New Zealand":
"Europe & New Zealand"
case "Europe, China":
"Europe & China"
case "Europe, Norway":
"Europe & Norway"
end
-
Thanks
-
@Sean thanks for introducing me to switch statements. I use it very effectively now
-
@Wynand, You're welcome. Glad you got it working.
Content aside
- 4 yrs agoLast active
- 11Replies
- 2618Views