SurveyGizmo's CustomScript Action now supports the LUA programming language.
Legacy Custom Scripting Language Deprecation Plans
New accounts (created after October 29, 2018) will only have the option to use Lua in scripts.
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.
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.
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.
You can use question Aliases in place of question ID almost universally in scripting and merge codes.
Why aliases are much better to use in scripts
You can use aliases in your script that mean something.
Your scripts can be re-used more easily across surveys. Question IDs change, aliases do not!
Your code will be more readable!
Your merge codes will be more readable!
Here's how it works
In the Alias field on the Logic tab of the question editor, enter whatever you want your variable name to be. Then simply reference this alias in place of the Question ID in your scripting.
For example, say you have 3 number-validated questions that ask "How tall is the box in feet?", "How wide is the box in feet?" and "How deep is the box feet?" The question IDs are 2, 3, and 4 respectively.
The script to calculate the volume would be:
volume = getvalue(2) * getvalue(3) * getvalue(4)
Seems easy enough yes? Well, if you've done a little scripting within Alchemer, you know that it is tough to reuse this script in a new survey. The likelihood that the question IDs will be the same in the next survey you build are pretty low. So, reusing scripts usually requires manually updating the IDs in order for it to work in a new survey.
If you use aliases instead, reusing the script is a cinch! It's also easier to read!
For example, take the same questions above and assign the aliases "height", "width", and "depth."
Now the script to calculate the volume would look like so: