How can I translate embedded data? | XM Community

How can I translate embedded data?


Badge +1

Hi everyone,
I've seen various questions about translating loop & merge fields, but not about embedded data. I have a survey that has embedded variables piped into the question text. I would like those variables to show up translated based on whichever language they select, and want to avoid creating 6 different versions of the question to display based on langauge selection.
I believe there's a solution that involves creating a hidden first question with answer choices that are each of the field's translated, for e.g.:
[hidden question] Q1
answer choice 1: hello
answer choice 2: hola
answer choice 3: bonjour
But I'm not sure how to then pipe this into a later question based on language selection. Or, if there is a different solution that would be great. Thank you in advance for your help!


12 replies

Userlevel 4
Badge +16

hi poonamwgupta

you dont even need three answer options just create one answer item and translate it in the translation layer.

and then simply put this in the embedded data:
edSalutation = ${q://QID1/ChoiceGroup/AllChoices?displayLogic=0}

QID needs to be the relevant question id. you can get there by using piped text

Best regards

Rudi

Badge +1

Hi Rudi,
Thank you so much for your helpful response! Apologies I think I mis-represented my question by using an inaccurate example -- my embedded data field will have several possible values that will be populated for each individual person/link (the data field is called 'organization' and possible values include, for example, 'Burger King'; 'McDonalds'; 'Wendys,' etc.) so, I cannot assign the data field a fixed value/translation within the embedded data. Is there still a way for each person's respective 'organization' to show up translated using this method?
Thank you again,
Poonam

Userlevel 4
Badge +16

Hi Poonam,

actually, you could use the same idea, slightly modified.
you could set a multi select question by javascript, auto-forward it and then set the embedded data with piped text edOrganization = ${q://QID1/ChoiceGroup/SelectedChoices}

Best regards

Rudi

Userlevel 7
Badge +27

poonamwgupta ,
You are on the right track with the hidden question, except 'hello' would be one choice that you would translate into Spanish and French. Then whenever you want to pipe hello/hola/bonjour you would pipe ${q://QIDx/ChoiceDescription/1}. The piped field will be hello/hola/bonjour in the current language.

Badge +1

Thank you Tom and Rudi!
This is making sense, but I'm not sure how this would work if each person and their link will have a pre-designated unique value for the embedded data field (as in, this value will be known and embedded prior to them taking the survey). While I can pre-populate the hidden question with choices that include all possible values of the embedded data field, and then translate those choices, is there a way to pipe in that person's specific embedded value later on in the survey?
Thanks again,
Poonam

Userlevel 7
Badge +27

Two possible approaches:
If you know the contact's preferred language, set the Language field in the contact list and populate the embedded field(s) in their language. Then just pipe the field(s). You can hide the language selector so they can't change language.
If you can't do the above, you could store the choice id of the hidden translation question in the contact list. Instead of hiding the question with survey/display logic, hide it with JavaScript and select the answer than matches the choice id from the contact list. Then pipe the selected answer.

Userlevel 2
Badge +3

On the piped text, how is the D value decided?  

I have tried below.

Piped Translations - pipe as${q://QIDx/ChoiceDescription/X}}

I understand Q1 is question 1, but how is Dx determined?

Userlevel 7
Badge +27

@VJTM,

QIDx is the internal question id.  For example, the question labeled Q1 might be QID3. If you use ‘Piped text’ and pipe the answer to a question (e.g., Q1) you’ll see the QID in the piped text string (e.g., QID3).

Userlevel 2
Badge +3

Hi Tom

I have displayed the element id of the radio button that is checked and I get these 2 ids.  There are 7 radio buttons in 2 rows.

QR~QID5~1~1

QR~QID5~2~1

So the QID5 should reference this question I assume.

My Piped Text is in a separate block - see attached screen shot.

And the text does not appear above the questions radio buttons 1 - 7?

 

Userlevel 2
Badge +3

Also, this is working in other surveys but the QID in these does not match the QID I get with JavaScript?

Userlevel 7
Badge +27

@VJTM,

It seems like you are doing it backwards.  Q7 would be your hidden translation question, then you would pipe the Q7 choice descriptions into your Q5 matrix. Q7 should be before Q5 and hidden with branch or display logic. 

Userlevel 2
Badge +3

Hi Tom, ignore I have got this working!

Leave a Reply