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

    This function shuffles the elements of a Lua table. Parameters Description Required array the array you wish to shuffle true Example The below example creates a new array and sets it equal to the original array that has been sh...
  2. setfontpdf

    This function sets the font and style of the given pdf.  See this function and other PDF functions in action in an example survey . OR Add a survey with a script with this function and otherPDF functions to your account. For more info on PHP ...
  3. newpdf

    This function creates a PDF object that you can store, build and output and send via the emailsend function.  See this function and other PDF functions in action in an example survey . OR Add a survey with a script with this function and other...
  4. imagepdf

    This function adds an image to the given PDF. See this function and other PDF functions in action in an example survey . OR Add a survey with a script with this function and otherPDF functions to your account. For more info on PHP PDF Creat...
  5. luadecrypt

    Decrypts the given encrypted string. Parameters Description Required string the string you wish to decrypt true key the string key/password used for encryption/decryption true ciphertype a string calling the cipher algorithm ...
  6. textpdf

    This function adds text to the given PDF.  See this function and other PDF functions in action in an example survey . OR Add a survey with a script with this function and otherPDF functions to your account. For more info on PHP PDF Creation ...
  7. PHP Functions

    There are a number of PHP functions that are available to leverage within your scripts. See the below list and reference the corresponding PHP function in the PHP Documentation: http://php.net/docs.php PHP functions available for use in SurveyGiz...
  8. Miscellaneous Lua Functions

    The Lua library provides some additional miscellaneous functions. The below list of miscellaneous functions is available to use in Alchemer Custom Scripting. Reference the corresponding LUA function in the LUA Documentation: https://www.lua.org/man...
  9. lprint

    This function was primarily created for outputting the list function to the page as the Lua print function results in merge code errors within the survey.  Parameters Description Required contents the contents you wish to print true ...
  10. Date: Calculate age from birthday

    This JavaScript will calculate age from the date of birth entered in an open-text field.  See this script in action in an  example survey . OR Add a survey with this script and setup to your account! The Setup and Script First, add your date...