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. Cascading Dropdown: Select option when only one is present

    If you are using the Cascading Dropdown question and one of your menus has only one option you might want to have the survey automatically select it for your respondents. While there isn't a built-in way to achieve this; we have a super-simple, co...
  2. Comment Field: Display above the question

    By default, Comment Fields will display below the question they are added to. This script will display a comment field above a question. See this script in action in an example survey ! OR Add a survey with this script and setup to your acco...
  3. removecontactfrominvite

    This function removes the given emailaddress from the given invite as specified by link ID .  Parameters* Description Required linkID the linkID and can be found in your email campaign true emailaddress the email address to r...
  4. Using Continuous Sum Total later in the survey

    There isn't a built-in way to use the total of the Continuous Sum question in another question. This script will populate a hidden value with the total from a Continuous Sum so that you can use the total later on in your survey. These steps assume a...
  5. getsurveyprogress

    This function returns the percentage progress based on survey pages. See this function in action in an example survey . Example If the below script is placed at the top of each survey page of a six-page survey (including the Thank You page) the ...
  6. Verify and disqualify based on birthdate

    This script will perform age verification based on the date of birth entered in a Date question. The qualifying age can be set in the script (18 years old, 21 years old, etc.) and if the user is not old enough, they will be disqualified. If they are...
  7. Other Textbox: Limit characters allowed

    Looking to limit the number of characters that can be entered in an Other Textbox ? While we don't have this feature built-in, it's something that can be accomplished with a little bit of custom JavaScript. See this script in action in an example...
  8. getquestionoptionselected

    This function returns the option ID for the selected answer. For multi-select questions, an array will be returned. See this function in action in an example survey . Parameters Description Required questionID the ID of the questio...
  9. 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...
  10. Text Fields: Add Placeholder Text

    Placeholder text in text fields is helpful when asking open-text questions that require a specific format e.g., phone number, email address, zip codes, etc. Alchemer has a built-in feature to add placeholder text to Textbox, Number, Email, Percen...