sgapiPageMap()

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 function returns an array of page skus keyed to an array of id => type, as in element type, for all elements in the entire survey, regardless of where in the survey it is used.

Return Type Survey Element Type
TEXTBOX Text fields including (textbox number, percent, email and date)
MULTI_TEXTBOX Textbox List
ESSAY Essay/Long Answer
CHECKBOX Checkboxes
RADIO Radio Buttons
MENU Dropdown Menu
SLIDER Slider
MULTI_SLIDER Slider List
NPS Net Promoter Score
RANK Drag & Drop and Ranking Grid
IMAGE_SELECT Image Select (Single and Multi)
TABLE All grid question types
FILE File Upload
CONT_SUM Continuous Sum
MAXDIFF Max Diff
GROUP Contact Form and Custom Group
MATRIX Custom Table
MEDIA Image Elements
INSTRUCTIONS Text/Instructions
AUDIO Audio
VIDEO Video

Example

In this example, we return the page map for the entire survey on the first page.

Check it out in an Example Survey

%%pagemap = sgapiPageMap();
%%output .= sgapiPrint_R(%%pagemap);

The output would be:

Array ( [12] => Array ( [160] => SCRIPT [17] => TEXTBOX [18] => TEXTBOX [19] => TEXTBOX [20] => TEXTBOX [21] => TEXTBOX [23] => MULTI_TEXTBOX [71] => TABLE [22] => ESSAY ) [3] => Array ( [3] => CHECKBOX [42] => TABLE ) [15] => Array ( [79] => RADIO [36] => TABLE [7] => MENU [10] => TABLE [61] => TABLE ) [16] => Array ( [4] => SLIDER [5] => MULTI_SLIDER ) [17] => Array ( [16] => RADIO [32] => TABLE [140] => NPS ) [18] => Array ( [27] => RANK [29] => RANK ) [19] => Array ( [15] => IMAGE_SELECT [9] => IMAGE_SELECT ) [13] => Array ( [80] => FILE ) [20] => Array ( [30] => CONT_SUM [141] => MAXDIFF [93] => GROUP [86] => GROUP [82] => MATRIX [142] => TABLE ) [21] => Array ( [152] => INSTRUCTIONS [153] => MEDIA [154] => MEDIA [155] => MEDIA [156] => AUDIO [159] => VIDEO ) [2] => Array ( [1] => INSTRUCTIONS )