Is it possible to set the Country dropdown value with Embedded Data? | XM Community
Question

Is it possible to set the Country dropdown value with Embedded Data?

  • 26 January 2021
  • 2 replies
  • 81 views

We have a couple of questions where we're confirming a respondent's address info and/or capturing changes. I'd like to use the pre-defined Country dropdown, but I'd like it to be set to whatever their Country is in their record in the Contact List (if we have it). In other words, can I set the value of the dropdown based on the embedded Country field in our pre-loaded data?
Now, I've seen something similar to this with javascript:
var select = jQuery("#"+this.questionId+" select");
   if("${e://Field/PREF_EMAIL_TYPE}" == "Personal") select.val("1");
   if("${e://Field/PREF_EMAIL_TYPE}" == "Business") select.val("2");
However, I don't want to have to program a line for every single Country (for obvious reasons).


2 replies

Userlevel 3
Badge +8

Can you not set the default country dropdown to an embeddedData field that captures the country by metaData or IP?

If you can, I haven't seen a way how. That's why I was looking into using javascript. Per the example I provided, I've seen it used to set the value of a dropdown if you only have a few choices. But coding it for a dropdown with 100 or so choices like Country would be crazy. I'd love it if there was an easier way.

Leave a Reply