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.
The below script creates and builds a PDF object, outputs it and adds it as an attachment to a send email action. In the highlighted portions of the script, we define a PDF title and create a new PDF object.
pdf = "Example PDF"
text = "Text to include in PDF"
size = 14
options = {['spacing'] = 1.5}
table = {row1={1,2,3,4}, row2={5,6,7,8}, row3={9,10,11,12}}
columns = {'Column A','Column B','Column C','Column D'}
newpdf(pdf,'letter','portrait')
setfontpdf(pdf,'courier')
setcolorpdf(pdf,0,1,1)
imagepdf(pdf,'https://surveygizmolibrary.s3.amazonaws.com/library/160589/surveysoftwareapi.png')
textpdf(pdf,text,size,options)
tablepdf(pdf,table,columns,'Table Title')
formattedpdf = pdfoutput(pdf)
attachment = {}
attachment['example.pdf'] = formattedpdf
--Attach to existing send email action (ID 30)
setquestionproperty(30,"email_attachments",attachment)
See also the following working examples for use of this function: