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.


Updated Articles

  1. Get Started

    The application supports two kinds of scripting actions in surveys: Custom Script Actions (using LUA version 5.1.4) and JavaScript Actions . You can add each to your survey by adding the script to either a Custom Script or JavaScript action respe...
  2. pdfoutput

    This function returns the output of your pdf. See this function and other PDF functions in action in an example survey . OR Add a survey with a script with this function and otherPDF functions to your account. For more info on PHP PDF Creat...
  3. Date: Calculate age from birthday

    This JavaScript will calculate age from the date of birth entered in an open-text field.  See this script in action in an  example survey . OR Add a survey with this script and setup to your account! The Setup and Script First, add your date...
  4. 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...
  5. setpageproperty

    This function allows you to set a specific property for a page with a given page ID for the active response session. Parameters* Description Required pageID the ID of the page true property the property you wish to set true ...
  6. 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...
  7. setrequired

    This function toggles the required status of a question. Parameters* Description Required questionID the ID of the question true true/false true hides the question and false shows the question false (default is true) *P...
  8. Disqualify based on previously collected data

    This script allows you to look up previous entries in a given field, say an email address, customer number, or other unique value, and disqualify respondents if they have already recorded a response.   See this script in action in an example surve...
  9. settitle

    This function sets the title of a question. HTML is supported. The language parameter is a required parameter. The possible values for the language parameter values are the languages available in the translation menu . Languages must be title c...
  10. hidequestion

    This function hides the specified question when set to true and shows the specified question when set to false. Parameters* Description Required questionID the ID of the question true true/false true hides the question and fa...