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. Lua Functions

    We have enabled a number of LUA functions that you can leverage within your scripts. There are math functions , table manipulation functions , string manipulation functions , operating system facilities , and several miscellaneous functions av...
  2. Working Examples of Custom Scripting

    These working examples of custom scripting cover some of our most frequently-requested survey customizations. These examples are built to plug and play. Template scripts like these are great for getting started with scripting.
  3. PDF Functions

    PDF functions allow you to build custom PDFs within a response. These functions are often paired with email action functions to send a custom PDF upon response submission.
  4. 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...
  5. Using CSS Classes in JavaScript

    When you are writing Javascript in SurveyGizmo and need to interact with the DOM, the most straightforward option is often to use the IDs of the specific elements that you are interacting with. For example, here is the HTML for an individual textbo...
  6. 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 ...
  7. removecontactfromlist

    This function removes a contact from an Email List . Parameters Description Required listID the ListID of your email list. You can find the List ID in your URL by going to Account > Email Lists and clicking into the email list. Yo...
  8. listremove

    This function removes the given response from the given survey. This is equivalent to deleting a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Parameters* Description Required su...
  9. translate

    The translate function creates a translation field for the specified string in the Text & Translation interface for each language version of your survey. The field is then available for each language in the Text & Translations interface to be tran...
  10. 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) ...