How to display currency based on the country selected? | XM Community
Solved

How to display currency based on the country selected?

  • 24 April 2018
  • 9 replies
  • 304 views

How do I store the currency of any country selected in qualtrics survey?
icon

Best answer by TomG 24 April 2018, 16:43

View original

9 replies

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
Userlevel 7
Badge +27
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
Badge +1

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. 

Userlevel 7
Badge +27

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).

Badge +1

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.

 

Userlevel 7
Badge +27

Updated demo link

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

Badge +1

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?​​​​​​​

Userlevel 7
Badge +27

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

Badge +1

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

Leave a Reply