Popular Articles

  1. Set Default Values For Empty Merge Code

    If you're a fan of merge codes , this simple and handy tool is made handier still by the ability to specify a default value when the merge code is empty! Question Value Merge Code when value is present. Question Value ...
  2. sgapiArray_Flip(%%array1)

    This is equivalent to the array_flip function in PHP. Given an array, this function will exchange an element's key with that element's value and return the resulting array. To see an example or learn more other PHP functions and PHP progr...
  3. sgapiStrLen(%%string)

    This is the equivalent of the strlen function. This function returns the length of the string. Example The below example will return the string length entered in the textbox from question ID 2. Check it out in an Example Survey ...
  4. sgapiArrayUnique(%%array1)

    This is equivalent to the array_unique function in PHP. Given an array, this function will remove any elements that contain duplicate values and return the deduped array. To see an example or learn more other PHP functions and PHP program...
  5. sgapiURLDecode(%%string)

    This is equivalent to the urldecode function in PHP. This function can be used to read information that is URL encoded. Example A good example would be reading information from a URL variable. //retrieve the string describing a...
  6. Email Campaigns & Actions

    These functions manage your email contact lists, create email content and trigger send email actions. sgapAddContactToInvite - This function adds the given contact to the given invite. sgapiRemoveContactFromInvite - This function...
  7. sgapiMd5(%%string)

    This is equivalent to the md5 function in PHP. It returns the MD5 hash of the provided string. Can be used to compare two strings for an exact match by comparing their MD5 hash values. To see an example or learn more other PHP functions a...
  8. sgapiTrim(%%string)

    This is equivalent to the trim function in PHP. This will remove all trailing and preceding whitespace. sgapiChop and sgapiTrim are helpful for anytime you need to pull or display variables with no spaces before or after them. For example, le...
  9. Show a Number of Randomly Selected Rows from a Grid

    As part of our core randomization options you have the ability to randomize columns and randomize row order in a grid question. Unfortunately, there is not a built-in way to only randomly show a subset of the rows in your grid question. Never fear! ...
  10. sgapiImagePDF(%%pdf, %%image, %%pad, %%width, %%resize, %%just, %%border)

    This function adds an image to the given PDF. Parameters %%pdf - The title of the PDF you are creating. %%image - The image URL. %%pad - Image padding by page unit (defaults to 5). Enter '0' for no padding. %%width - The width of the...