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.
While there is no built-in functionality to populate a continuous sum question with previous continuous sum questions we have a script to accomplish this! This can come in handy if you have different totals that you want to add to make one overall total. These steps assume a basic familiarity with Alchemer and Custom Scripting.
Start by building all of your survey questions. In this example survey, we have two continuous sum questions that will be adding on the first page.
On the next page, we have a custom script action with the below script followed by two hidden values. These hidden values will be populated by the script.
You'll need to change the IDs for the continuous sum questions and hidden values.
contsum1 = 7 --Question ID for first Continuous Sum
contsum2 = 8 --Question ID for second Continuous Sum
sum1 = 5 -- ID of hidden value for first sum
sum2 = 6 -- ID of hidden value for second sum
next_pageID = 3 --ID of page to jump to so page with script does not show.
array = getvalue(contsum1)
chars = {'%','$','₠','₡','₢','₣','₤','₥','₦','₧','₨','₩','₪','₫','€','₭','₮','₯','₱','₲','₳','₴','₵','₶','₷','₸','₹'}
finalval=0
for key,value in pairs (array) do
val = str_replace(chars, '', value)
val = tonumber(val)
finalval = finalval+val
end
setvalue(sum1,finalval)
array2 = getvalue(contsum2)
finalval2 = 0
for key2,value2 in pairs (array2) do
val2 = str_replace(chars, '', value2);
val2 = tonumber(val2)
finalval2 = finalval2+val2
end
setvalue(sum2,finalval2)
jumptopage(next_pageID)
Now on the third page, add the third Continuous Sum question where you wish to add all the values together. Populate the Default Value field for each option with the merge code for the Hidden Value sums we populated in the script.
Now you're ready to test your survey. Is your third continuous sum populating with the totals of the first two creating and total sum? If so, you've succeeded! Congratulations! If not, double check your question IDs.