Add a Custom Script (LUA) to Your Survey

Important Update to Custom Scripting

SurveyGizmo's CustomScript Action now supports the LUA programming language. Visit our NEW Lua Scripting Resources!

Legacy Custom Scripting Language Deprecation Plans 

  1. New accounts (created after October 29, 2018) only will 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 future, any Legacy Custom Scripting Actions will be switched to read-only.

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. SurveyGizmo provides a library of functions available for you to interact with a survey programmatically. 

Add a Custom Script to your survey

To add a custom script action to your survey follow these steps:

  1. Click the Action button at the bottom of any page in your survey.
  2. Give your action a name. It's a good idea to describe what the script is doing, for example, "Disable after answering."
  3. Select Custom Script from the menu. You will be taken to the script editor.
  4. Select the type of script that you will be writing. There are two options:
    • Lua - default (version 5.1.4)
    • Legacy Custom Scripting (Only available to accounts created before October 29, 2018)
  5. Write or paste your script into the Script Code field. If you need to reference page, question or option IDs to use in your scripts, use the Question & Page ID Lookup menu. This menu is for reference only, clicking on the IDs within the menu will not insert them into your scripts.
    Custom Script: Primary Setup Tab

Using Logic in Custom Script Actions

On the Logic tab you can set up conditions for when you want your script action to run. This is configured in the same way as Question Logic.

Change the Script Editor Look & Feel

If you want to change the look of the script editor, you can choose a different color scheme on the Advanced tab of your action. 

Custom Script: Editor Theme

Basic Standard Market Research HR Professional Full Access Reporting
Free Individual Team & Enterprise
Feature Included In