Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Multi currency/language in ACBC

Hi,

We have a study including US (variable Country = "US") and Canada (Country = "CA") . I have downloaded Multi-CurrencyACBC question and BetterLighthouseLibrary from the Questionnaire Library. I used
"[% Country %]" == "US" or "CA"
in the SHOW: line to separate USD from CAD. It works fine meaning CAD is displayed correctly with the exchange rate.

However I also need to display French for some Canadian respondents (the  LABEL: line). So I separated CA into 2 "currencies" by replacing the script in the line SHOW: by
"[% Country %]" == "CA" && "[% lang %]" =="EN"
"[% Country %]" == "CA" && "[% lang %]" =="FR"

(lang is the variable separating EN from FR respondents)
but it is still not working. I also tried to put each of the above 2 statements into () but it still did not work. Please help.

Maybe there is a way to add scripts in the LABEL: line to display EN or FR based on the variable lang? If so please help with scripts. Thanks
asked Apr 4 by anonymous
Nothing about your proposed script looks off to me.  I'm not sure what aspect of it is not working, but my best guess would be that the value of "lang" is not quite right.  If the variable were being set by a select question, for example, then that Sawtooth Script function would return a number rather than "EN."  The equality check would also fail if the value were lowercase ("en") or had any additional characters including whitespace (" EN ").  Could something like that be at play in your questionnaire?

The label field could absolutely support conditional text with something like this:

label: "[% lang %]" == "EN" ? 'label 1' : 'label 2',


This uses the same Sawtooth Script function, though, so may suffer from the same issue as your current code.
Both Country and lang are passed through text variables with values US/CA and EN/FR. I copied the passed through data and pasted them into Notepad. The cursor did move to next line in Notepad.

Your label statement works now. Not sure why the script for the line SHOW: did not work.

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.
...