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. sethtmlemail

    This function sets the content of an HTML version of a send email action. Parameters* Description Required questionID the ID of the send email action for which you are specifying content true content the email content true ...
  2. ishttps

    This function returns a boolean for whether or not the survey link is set to secure (https). Example In the below example we're running a snippet of code if the link is secure. if (ishttps() === true then -- code end ...
  3. submitsurvey

    This function submits the data from the current page and records the response as a partial. All data from previous pages will be stored for reporting. Note: this will not submit the current page and move to the next. To do that, use jumptopage ....
  4. Checkbox Grid and Radio Button Grid: Make Other Textbox rows required

    Other Textboxes within grid questions do not force a response if the answer the row. This JavaScript will disable and uncheck the other row's answer options unless text has been input in the Other Textbox. See the script in action in an example su...
  5. randomizetable

    This function shuffles the rows of the given table. Parameters Description Required questionID the ID of the question true Example In the below example we randomize the rows of table question ID 2. randomizetable(2) ...
  6. pipematrixrows

    This function pipes the given rows into the given Custom Table question. You can specify a static value or pull selected values from a previous question. Parameters* Description Required questionID the ID of the question true p...
  7. getsurveyproperty

    This function returns the given property for the current survey. Parameters Description Required property property to get true Available Properties Description Return Values survey_interaction_desktop Desktop survey...
  8. settextemail

    This function sets the content of the plain text version of a send email action. Parameters* Description Required questionID the ID of the send email action for which you are specifying content true content the email content ...
  9. Radio Buttons: Allow respondents to deselect

    Once an answer option has been selected in a radio button question browsers do not allow for the option to be deslected. That could be troublesome if it was an accidental click with no Other or N/A options, so here is a quick bit of JavaScript that ...
  10. Radio Button Grid: Swap columns and rows

    If you want to display single choice in a Radio Button Grid vertically this JavaScript will do just this but record the data in the same format by row. See the script in action in an example survey ! OR Add a survey with this script and setup ...