Add a Custom Script to Your Survey

 Important Update to Custom Scripting

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

Please visit the Lua 5.1 Reference Manual for syntax and examples.

Coming Soon: Documentation of Lua functions that can be used in SurveyGizmo.

  • Any previous/existing Custom Scripts will continue to operate without issue.
  • New CustomScript Actions allow use of either the Legacy Custom Scripting (PHP-based) programming language or the LUA programming language.

SurveyGizmo provides a library of functions, including many useful PHP functions, available for you to interact with a survey programmatically. If you are familiar with PHP, this should be relatively easy for you to pick up!

Learn more about Custom Scripting here:

http://script.surveygizmo.com/help

Adding a Custom Script to Your Survey

To add a custom script action to your survey, 

  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 action is doing in the name, 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 current options:

    • Custom Scripting
    • Lua
  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