Popular Articles

  1. sgapiRemoveContactFromInvite(%%linkID, %%email)

    This function removes the given contact from the given invite as specified by %%linkID. linkID is the inviteID and can be found in your email campaign. Example In this example, we'll remove a contact from the email campaign with ID 1234...
  2. Record Time Spent On Page or Survey In Milliseconds

    We have a way to record time spent on page in seconds within a Hidden Value. If you wish to be more precise by recording the time spent in milliseconds you can do so with a little bit of JavaScript! Add a survey with these scripts to your a...
  3. sgapiArray_Diff(%%array1,%%array2)

    This is the equivalent to the array_diff function in PHP. Given two arrays this function will compare %%array2 against %%array1 and return an array of values that are present in %%array1 but not present in %%array2. To see an example or lea...
  4. Store Past or Future Date and Time

    Ever want to use a future or past date dynamically in a survey? We have just the workaround for you! In this tutorial we will cover adding or subtracting time to/from the current date.  Check it out in an example survey OR Add a su...
  5. sgapiChop(%%string)

    This is equivalent to the chop function in PHP. This will remove the trailing whitespace. Example The below example will output the following: Text to Left all this whitespaceText to Right. %% string = ' all this whitespace ...
  6. sgapiTrimStr(%%string)

    This is equivalent to the chop function in PHP. This will remove the trailing whitespace. Example The below example will output the following: Text to Left all this whitespaceText to Right. %% string = ' all this whitespace ...
  7. sgapiMCrypt

    Warning! We highly discourage use of this feature going forward as this has been deprecated in PHP. Learn more. This is equivalent to mcrypt_generic in PHP. This function encrypts data. The following parameters are supported in the sgapiMCr...
  8. sgapiSetHTMLEmail(%%questionID,%%value,%%language = "English")

    This function sets the content of an HTML version of a send email action. Parameters %%questionID - The ID of the send email action for which you are specifying content. %%value - The content you wish to use (string). ...
  9. sgapiListReplace(%%surveyID, %%reponseID, %%array)

    This function replaces the given response for the given survey with the array items. This is equivalent to updating a SurveyResponse object via the RestAPI. To learn more visit the SurveyResponse API Object documentation. Example In t...
  10. sgapiPreg_Match(%%pattern, %%subject, %%matches, %%flags, %%offset)

    This is equivalent to the preg_match function in PHP. Use to perform a regular expression match. To see an example or learn more other PHP functions and PHP programming, visit PHP Documentation . ...