How To use the the SurveyCache Extension DLL

Overview

The SurveyCache Extended DLL is designed to enable you to store information during an interview and then use that information the next interview, or the one after that etc. Although this capability can have numerous usages, the most common usage is for saving the answer of a question in the first interview and then use it later to pre-populate the same question on the next interview run with the answer of the previous run. For example:

  • You are conducting a survey that interviews customers in a shop. The first question is the shop name which the interviewer should input, and then a series of questions about a customer is asked.
  • Your interviewer is interviewing 20 people in one shop.
  • To allow for fast entry, you would like the shop name in Q1 to be automatically pre-populated in all the interviews after the first time the interviewer fills it out.
  • This is a classic case for using the SurveyCache Extension DLL 

Using the SurveyCache extension DLL

To use the SurveyCache Extension DLL you will need to follow these steps:

  1. Step1: Add the SurveyCache as an attachment
  2. Step2: Activate the SurveyCache functions from within the survey

Step1: Add the SurveyCache as an attachment

To add the SurveyCache Extension DLL attachment, follow these steps:

  1. Download the SurveyCache.dll file from http://www.dooblo.net/stgi/docs/SurveyCache.rar
  2. Open the SurveyToGo Studio and then open the relevant survey.
  3. On the survey properties screen, switch to the “Advanced” tab and then click on the “Survey Attachments” link:

  4. Click the “New” button to add a new attachment to the survey:

  5. Click the “…” button to locate the SurveyCache.dll file you have downloaded and then change the Attachment Type to be “ExtensionDLL”:

  6. Click the OK button, you should now see the SurveyCache listed as an attachment:

  7. That’s it. 

Step2: Activate the SurveyCache functions from within the survey

To activate the SurveyCache functions, you can follow the same steps as with any extension DLL. The functions available for use with the SurveyCache are:

Function

Description 

StoreValue (ID:1)

Stores a string value into the survey cache. More than one values can be stored. Use the “key” parameter to this function to store more than one value.

LoadValue (ID:2)

Retrieves a stored string value from the Survey cache. Use the “key” parameter to identify which stored value you would like to retrieve

 

StoreValue function:

The store value function allows you to store values in the survey cache. It has the following parameters:

Parameter 

Description 

Example 

Key (param1)

Specifies an identification key that indicates where to store the value.

Can be any string. Used for identification. Example: “ShopName” or anything else.

Value (param2)

The actual string value you would like to store.

Can be any string. Example: “Starbucks on 27th street”

 

To use the StoreValue function you would write a script like this:

 

ExtFunc (“SurveyCache.dll”, 1, “ShopName”,Answer(2));

This script will store the answer to Q2 in the SurveyCache under the “ShopName” key for later retrieval.

 

LoadValue function:

The LoadValue function allows you to retrieve values stored in the survey cache. It has the following parameters:

Parameter 

Description 

Example 

Key (param1)

Specifies an identification key that indicates where the value is stored

Can be any string used in the previous StoreValue function. Example: “ShopName” or anything else.

 

To retrieve the value stored in the “ShopName” key using the LoadValue function you would write a script like this:

ExtFunc (“SurveyCache.dll”, 2, “ShopName”);

This will return a string value that was stored in the SurveyCache under the “ShopName” key.

Example: To set the FreeText question Q2 to be this value your Q2 start script should read:

SetAnswer (CurrQuesExtFunc (“SurveyCache.dll”, 2, “ShopName”));

 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.