Use Signature Question Later in Survey

Important Update to Custom Scripting

SurveyGizmo's CustomScript Action now supports the LUA programming language. Visit our NEW Lua Scripting Resources!

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. The exact date on this is to be determined; we will send notifications well ahead of time.

This script will allow you to use a signature question's input later in a survey.

Check it out in an example survey!


Add a survey with this setup to your account!


First set up your signature question. On a following page that you want your Signature Image to show up click Add New Action > Custom Script and paste the following script in that field. 

%%data = sgapiGetQuestionRuntimeProperty(2,'Data');
%%data = (array)%%data;
%%data = (array)%%data['atoms'];
%%data = (array)%%data[0];
%%data = %%data['raw_value'];
%%data = %%data['signature'];
if (%%data != ''){
  %%base64d = sgapiBase64Decode(%%data);
  %%signature = '<img src="' . %%base64d . '">';
  %%signature = "No Signature Entered";

%%output .= sgapiPrint_R(%%signature);


Error Message - If a respondent does not answer the question and your question is not required it will display the highlighted text "No Signature Entered." You can change that text or set the question to required to display the built-in required message. 

Question ID - The highlighted 2 will need to be changed to the question ID of your signature question. To learn more about how to find the question ID check out our tutorial on Finding IDs.

Scripting and Other Custom Solutions

We’re always happy to help you debug any documented script that is used as is. That said, we do not have the resources to write scripts on demand or to debug a customized script.

If you have customization ideas that you haven't figured out how to tackle, we're happy to be a sounding board for SurveyGizmo features and functionality ideas that might meet your customization. Beyond this, you might want to consult with someone on our Programming Services Team; these folks might have the scripting chops to help you to achieve what you are looking for!

@plans @pro @ent