Trying to assign multiple values to the same Embedded Data field across multiple branches. Doable? | XM Community
Solved

Trying to assign multiple values to the same Embedded Data field across multiple branches. Doable?

  • 3 February 2021
  • 2 replies
  • 258 views

Userlevel 6
Badge +5

I have a check all that apply question asking what region someone is located in. Then for each region, I assign contact information that is region-specific via branching and Embedded data. However, if someone selects multiple regions I would like the contact info for both regions added to the same ED separated by a comma. Does anyone know if this can be done without custom coding?

icon

Best answer by ahmedA 4 February 2021, 02:23

View original

2 replies

Userlevel 7
Badge +21

Depends on how many options you have.
The brute force way could be this:
image.png

v2 
now has the value
Second Value, First Value
. You could create a branch for each option and append the contact info.

Another approach could be to use Loop & Merge (LM). This takes less time, but give a dirty solution with extra commas:
Step 1: You start with a Pre-LM block, where you ask your question.
Step 2: You create a loop and merge block, selecting loop off a question and the required values in the second field.
image.pngStep 3: You use the second field as the question text and use the TRUE-FALSE display logic to not show the question to the respondent.
image.pngStep 4: You use piped text to pass all the possible values to another question text. Once again hiding it.
image.pngStep 5: You assign the value of this question text to an embedded variable.
image.png
Demo here.
Point to not: If you try to set the embedded variable directly skipping step 4. You'll end up with repeated values.

Userlevel 6
Badge +5

ahmedA Very clever. Thanks!

Leave a Reply