Storing Reference Data Base for Calculations | XM Community
Solved

Storing Reference Data Base for Calculations

  • 30 September 2019
  • 4 replies
  • 2 views

Userlevel 7
Badge +19
  • Level 5 ●●●●●
  • 544 replies
My senario is this: I want individuals to enter their origin: "Zip Code A". From there, I would qualtrics to be able to reference a database of Zipcodes to determine how far "Zip Code A" is from my location, "Zip Code B".

I can easily make a list of possible Zip Codes A and their distance from me in a spreadsheet. But how do I get Quatlrics to reference that and spit out a distance for me to use in embedded data calculations?

We're working on a LEEDs survey to measure the C02 Emissions incurred by respondents as they travel to our building. I need to take this distance and be able to multiply it by the number of trips the respondent takes in a week, multiplied by the C02 Emissions incurred by each method of transportation. Without Qualtrics doing half this work for me, I'm in for a really long analysis. But it definitely feels like something I should be able to use math operations for pretty easily if I can solve this "distance" problem.
icon

Best answer by JenCX 30 September 2019, 23:56

View original

4 replies

Userlevel 7
Badge +11
I thought I remembered something @TomG had said about a similar ask

So to quote our great guru (or Wizard, I should say), it should be possible to do this if you store the zipcodes in an external web database, then use an ajax call to check for the corresponding distance. I don't know how to do any of that but I suppose it's a place to start?
Userlevel 7
Badge +27
> @JenCX said:
> I thought I remembered something @TomG had said about a similar ask
>
> So to quote our great guru (or Wizard, I should say), it should be possible to do this if you store the zipcodes in an external web database, then use an ajax call to check for the corresponding distance. I don't know how to do any of that but I suppose it's a place to start?

@Kate,

Probably the easiest solution is a web service call from the survey flow to a script that does a database lookup (and distance calculation). Ajax adds additional complexity that you only need if it has to be interactive (i.e., on the same page). From your description, it doesn't sound like you need that.
Userlevel 7
Badge +19
@TomG This is pretty new to me- do you have any suggestions on some learning materials to start to get aquainted with web service calls?
Userlevel 7
Badge +27
Kate,

Making a web service call is fairly straightforward:
https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/advanced-elements/web-service/#AddingAWebService

The move involved part is creating the server side script and database. Here is a link to a message I posted that provides the basic flow of a web service script:
https://stackoverflow.com/a/43481680/4434072

Leave a Reply