Have an idea?

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

Show image based on quota assignment

I am showing an image in a CBC exercise that I would like to change based on a quota assignment determined earlier in the survey.  

For background, I'm doing this because one of the brand attributes in the CBC varies based on geographical location (i.e. the brand name/logo is different based on where US), so I'd like it to appear with the logo that should be most familiar to the respondent.

I have 4 groups/4 images I'd like to show, so something like this:

if quota=1 then imageshown=1
if quota=2 then imageshown=2
if quota=3 then imageshown=3
if quota=4 then imageshown=4

I feel like the link below has a response is close to what I need, but I've been toying with adjusting the code and can't seem to solve it.

closed with the note: Answered
asked Oct 15, 2020 by Leslie (220 points)
closed Oct 16, 2020 by Leslie
Hopefully I can help clear up any confusion about using that code.  I'd start by adding the four images to your graphics folder.  For ease, I'd give them the same name except with a single number changing from 1 to 4.  For example:


Then the image code you can use in your CBC just needs to be this:

<img src="[% GraphicsPath() %]brand[% QuotaQ %].png"/>

Of course, "QuotaQ" has to be replaced with the name of your quota question and you'd need to change the "brand" and "png" parts to match your image files.
Got it - brilliant solution, thanks!!