How to display currency based on the country selected? | XM Community
Skip to main content
How do I store the currency of any country selected in qualtrics survey?
I have a dropdown with list the list of countries, I would like to append the selected countries in the another dropdown or embedded data
You can use the REST countries web service to look up the currency information for the selected country. If your country drop down question was QID1, the web service call would look like:

!



The full web service url is:

```

https://restcountries.eu/rest/v2/name/${q://QID1/ChoiceGroup/SelectedChoices}?fullText=true&fields=currencies

```

Demo

Is there an update to the REST call URL provided above? I am trying it out but I receive an not found error, even after replacing the domain to .com.

Any suggestions would be appreciated. 


Is there an update to the REST call URL provided above? I am trying it out but I receive an not found error, even after replacing the domain to .com.

Any suggestions would be appreciated. 

I updated the demo survey and the web service call has changed a bit. It is now:

The latest version of the API is v3.1, but it doesn’t work well with a direct Qualtrics web service call because the currency code is embedded in the currency field names (e.g., 0.currencies.USD.name).


Hi Tom, thank you for your reply.
I tried making the changes your suggested but I still receive the following error. I try playing around with naming of the embedded data, the URL (changing it to v3.1) or the parameters, but this receiving this error.
I also tried accessing your demo link but it tells my I am not authorized to view it.

 


Updated demo link

To use the web service Test button, you have to replace the piped field with an actual value (e.g., Canada)


Hi again Tom,

One last question. Am i forgetting to do something else to make this work? I’ve copied your example to the T (although I’ve changed the question number accordingly) but I still can’t get it to work. I’ve created a question where I pipe in the embedded data but all I get is empty fields when I preview the survey.


However, when I inout a generic URL in the Web Service settings, the link below for Aruba for example, it seems to work fine (https://restcountries.com/v3.1/name/aruba?fullText=true).

 

What am I doing wrong or forgetting to do?​​​​​​​


As I tried to explain in my earlier post, you need to use v2, not v3.1.


Hi Tom, I am using V2, but the issue is still there. 


Leave a Reply