Popular Articles

  1. API Functions

    These functions allow you to make some common API calls to the SurveyResponse object. sgapiList - This function returns the list of responses for the given survey. This is equivalent to a get list on the SurveyResponse object via the Re...
  2. sgapiRSort(%%array, %%flag)

    This is equivalent to the rsort function in PHP. This function sorts an array in reverse order (highest to lowest), and then reindexes it. This means the keys are now numerical. The %%flag parameter defaults to "SORT_REGULAR". See the PHP do...
  3. Performing Basic Math Using Scripting: Add, Subtract, Multiply, and Divide

    Do you need to perform basic math within a response? You can do so using our custom scripting. Because our scripting language is based on PHP any of the operators that are available in PHP are available in our scripting language, and thus, in our su...
  4. sgapiRemoveContactFromList(%%listID, %%email)

    This function removes a contact from a Contact List. Example In the below example we remove the contact specified in question ID 10 from an existing Contact List inside the Contact Management system. %%listid = 116; %%email = sg...
  5. Piping from a Checkbox Question Into Multi-Slider

    Unfortunately the multi-sliders question does not have piping as a feature, but we can do this through a custom script as illustrated here. For this to work the target question must be setup with slider option names which correspond to the opti...
  6. sgapiRunAction(%%questionID)

    This function causes the given action to run and returns true if it is successful (returns false if given questionID is not an action). Example sgapiRunAction(27);
  7. sgapiListRemove(%%surveyID, %%responseID)

    This function removes the given response from the given survey. This is equivalent to deleting a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Example The below example removes...
  8. sgapiBase64Encode(%%data)

    This is equivalent to the base64_encode function in PHP. It encodes %%data with base64. To see an example or learn more other PHP functions and PHP programming, visit PHP Documentation . ...
  9. sgapiCount(%%array)

    This is the equivalent of the count function in PHP. It returns the number of elements in an array. To see an example or learn more other PHP functions and PHP programming visit PHP Documentation . ...
  10. sgapiStr_Replace(%%search,%%replace,%%subject)

    This is equivalent to str_replace function in PHP. This function looks for %%search inside of %%subject and replaces all %%search values with %%replace. The %%search attribute can be a single value or an array of values. If %%search is ...