Formula: USE_RANDOM_LOOKUP

This article will explain provide details and examples of this formula syntax usage


Background

This formula syntax will randomly return a record from an uploaded file. Once it has been assigned, it will cannot be assigned again. It will also be marked in the file as being used. The best example for using this formula is when assigning a random gift code. 


Formula Syntax

USE_RANDOM_LOOKUP ( "FILE_NAME", "FETCHED_COLUMN" )

  • "FILE_NAME": 
    • Is the name of the lookup file you have uploaded to your survey
    • Must be surrounded by quotes
  • "FETCHED_COLUMN": 
    • The exact text in the corresponding header column you are trying to return
    • This must be surrounded by quotes 

Examples

Example

You have a predetermined list of gift codes and you want to give each code out to a respondent and only use each one once.

You will need to program the following:

  • Program a 'Single' hidden variable without a response list
    • For this example, we will call this 'CODE'
  • Prepare and upload your lookup file
    • Lookup files must be in .csv format
    • For this example, we will call the lookup file 'INCENTIVE'
    • Your lookup file will look like this: 
  • Actual formula used:
    • Only if CODE=""
      Set Variable 'CODE' to
      USE_RANDOM_LOOKUP ( "INCENTIVE", "GIFT_CODE")
  • Now you can use our standard piping syntax to display the code on a screen for the respondent
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us