sgapiPageMap()

Important Update to Custom Scripting

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


  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 TypeSurvey Element Type
TEXTBOXText fields including (textbox number, percent, email and date)
MULTI_TEXTBOXTextbox List
ESSAYEssay/Long Answer
CHECKBOXCheckboxes
RADIORadio Buttons
MENUDropdown Menu
SLIDERSlider
MULTI_SLIDERSlider List
NPS®Net Promoter Score®
RANKDrag & Drop and Ranking Grid
IMAGE_SELECTImage Select (Single and Multi)
TABLEAll grid question types
FILEFile Upload
CONT_SUMContinuous Sum
MAXDIFFMax Diff
GROUPContact Form and Custom Group
MATRIXCustom Table
MEDIAImage Elements
INSTRUCTIONSText/Instructions
AUDIOAudio
VIDEOVideo

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 )