Lua Scripting Resources

Important Update to Custom Scripting

SurveyGizmo's CustomScript Action now supports the LUA programming language.


Legacy Custom Scripting Language Deprecation Plans 

  1. New accounts (created after October 29, 2018) will only have the option to use Lua in scripts.
  2. As of October 29, 2018 Custom Scripting Actions will default to Lua as the scripting type in the Custom Scripting Action for accounts created before this date. You will be able to switch to the Legacy Custom Scripting; though we highly encourage using Lua.
  3. In the long term, Legacy Custom Scripting Actions will be switched to read-only. Read-only scripts will continue to function; you will just be prevented from editing. The exact date on this is to be determined; we will send notifications well ahead of time.


 Go to our Legacy Scripting Documentation.

While SurveyGizmo is one of the most flexible survey tools around, we get requests for customizations that are not available out of the box. This is where JavaScript and Custom Scripting can save the day. If you have scripting chops you can use the JavaScript action or the Custom Scripting action to achieve the survey of your dreams.


Popular Articles

  1. Record page title of randomized pages

    Randomization is a very popular survey tool for eliminating bias introduced by order and/or survey fatigue. Within Alchemer you can randomize questions, pages (or pages in groups) or even answer options! We have a merge code [page("pagepath")]  tha...
  2. Custom Table: Sum a column

    Looking to sum the inputs of a Textbox column in a Custom Table?* This script will display the sum to the respondent below the Custom Table. Note, this script does not record the summed value for reference later. See this script in action in an e...
  3. Use scripts to perform basic math

    Do you need to perform basic math within a response? You can do so using our custom scripting. Because our scripting language is based on Lua any of the operators that are available in Lua are available in our scripting language, and thus, in our su...
  4. Images: Make an image appear for a specified amount of time

    This JavaScript will allow you to only show an image for a certain amount of time.  See the script in action in an example survey ! OR Add a survey with this script and setup to your account. The Script First, add your image element that y...
  5. csvsplit

    Splits the given comma-separated string into an array. Parameters Description Required string the comma-separated string you wish to split into an array true Example In the below example we create an array from a comma-separated li...
  6. htmltopdf

    Converts the HTML provided in contents parameter to a PDF file. Parameters* Description Required contents the HTML you wish to send to pdf true landscape The array of data to include in the table. false (default is false) ...
  7. Dynamically set Continuous Sum Max Total

    The Continuous Sum question is a very popular question, particularly with our market researchers. Often survey designers are looking to make sure that the continuous sum total matches another value that the respondent entered. In this tutorial, we'l...
  8. jumptopage

    This function jumps the respondent to the specified page ID. See this function in action in an example survey . Parameters Description Required pageid the ID of the page true Example In this example, respondents who answer ...
  9. referrer

    This function returns the URL of the webpage that linked to the survey for the given respondent. Example In the below example survey we output the Referrer to the page which is this tutorial! print(referrer()) Note: The referrer is not always a...
  10. Making a read-only field

    Many users like to use our default answers feature to pre-populate their survey. Often they wish to make this field appear as read only so that the respondent cannot change the answer. While this is not a built-in feature, we do have some easy-to-...