What's on this page:IntroductionConnecting Your Survey to a Web ServiceDisplaying a Web Service Field in Your SurveySending Parameters to a Web Service
Sometimes it’s useful to bring additional information from a website into your survey. Our Web Service element allows you to do just that. For example, you can pull in the top 10 Headlines from CNN.com for a current events survey. You can even write your own web program and then integrate accordingly.
Connecting Your Survey to a Web Service
- Click the Survey Flow in the Survey module.
- Click Add Below or Add a New Element Here.
- Choose Web Service.
- Click and hold the Move button on the Web Service and drag it to the top of your Survey Flow.
- Paste the URL of your external Web Service (RSS Feed is a commonly used type) into the URL field of the Web Service element.
Example: The images above display the URL to a simple Qualtrics Web Service (http://reporting.qualtrics.com/projects/randomNumGen.php). This Web Service generates a random number that you can use in your survey. To set limits on the random number that is generated, you can send the “min” and “max” parameter to the Web Service. In the images above, the “max” parameter is sent, limiting the random number between 0 (the default min) and 5000.
- Click Test URL to see which information you are able to pull from the external Web Service.
- Select any fields that you want to use or record in your survey (notice the field name appears in the left column and an example value in the right column).
- Click Add Embedded Data after you have made your selection.
- If desired, change the field names of your Web Service (the field names are to the left of the “=” sign; the right side should not be altered).
Qtip: The names you set here will be the names that appear in your data in the Data & Analysis module.
- If desired, select the Fire and Forget setting.
Qtip: Fire and Forget allows your survey to make a request to a Web Service without waiting for a response. This means that your respondents will be able to complete the full survey without any delay due to the Web Service. If you have a Web Service request that may take a while to process, be sure to check the Fire and Forget option.
- Click Save Flow.
Displaying a Web Service Field in Your Survey
- Go to the question or choice you’d like the field to appear in.
- Click Piped Text and choose Embedded Data Field.
- Enter the name of your field exactly as it appears in your Survey Flow and click Insert.
To see which data the respondent received from the Web Service, look for the Embedded Data field columns in your dataset. These Embedded Data fields can also be included in your Reports.
Sending Parameters to a Web Service
You can access RSS feeds with no strings attached, but more advanced Web Services may require information from you before they can send you anything back.
To add a parameter to your web service
- Select Add a parameter to send to web service.
- Type in the name of the parameter in the Parameter to Web Service box and the value of the parameter in the Value box.
- Select the plus sign to the right of the parameter to add another.
- Click Save Flow.