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. Use Signature question later in the survey

    This script will allow you to use a signature question's input later in a survey. See the script in action in an example survey ! OR Add a survey with this script and setup to your account. Features and functions used in this script: Sig...
  2. Image Select (Multi): Add N/A option

    The image selection question does not allow you to have an N/A Exclusive option. This tutorial will walk you through adding an exclusive option where no other images can be selected if the N/A option is selected.  See the script in action in an  ex...
  3. responsereset

    This function clears all data from the current response. See this function in action in an example survey . Example This function can be used to clear the current response (using responsereset) and begin again (using jumptopage). doover = getva...
  4. 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) ...
  5. resultsquestiontotal

    This returns the cumulative sum of all the numeric values answered for the given question ID from complete responses that have been processed. If summing the values for a question with options (Radio Button, Dropdown, Checkboxes) the function req...
  6. resultsquestionaverage

    This function returns the average answer for the given question ID from all c omplete responses that have been processed . The average that is returned will not include data from any responses that haven't been processed; this includes the current...
  7. getquestionresponsecount

    This function returns the response count for the given question ID from all responses that have been processed . The response count that is returned will not include data from any responses that haven't been processed; this includes the current res...
  8. checkboxtotalchecked

    This function returns the number of checkboxes selected for the given question. See this function in action in an example survey . Parameters Description Required questionID the ID of the question true Example In the below e...
  9. hideoption

    This function hides an answer option by reporting value. The true/false parameter can be used to support changes in answer options when respondents use the back button. See this function in action in an example survey . Parameters* Descripti...
  10. removeoption

    This function removes a multiple-choice option (by reporting value). For table questions, it hides the column associated with that reporting value for all rows. This will not reset if back button is used. If you'd like to have the option reappear us...