Popular Articles

  1. sgapiSetPipeValues(%%questionID, %%array)

    This function question pipes the given question based on the values specified in %%array. Example The below example question pipes the array from question ID 4, a checkbox question, and question pipes question ID 5 from this array of va...
  2. sgapiEmailSend

    This function constructs and sends an email at the runtime of your custom script. sgapiEmailSend(%%to, %%toName, %%from, %%fromName, %%subject, %%textBody, %%htmlBody, %%bcc, %%mailReplyTo, %%type, %%attachments) Parameters* %%...
  3. sgapiArraySearch(%%needle,%%haystack)

    This is equivalent to the array_search function in PHP. Given a value(%%needle) and an array (%%haystack) this function will return the key. To see an example or learn more other PHP functions and PHP programming, visit PHP Documentation...
  4. sgapiHTMLTOPDF(%%contents, %%landscape, %%border)

    Converts the HTML provided in %%contents to a PDF file. %%landscape and %%borders parameters are boolean values and are optional. By default, the %%border parameter is true, and the %%landscape parameter is false. The %%border parameter wi...
  5. Use Autofill JavaScript To Save Time Taking And Testing Surveys

    Ever get tired of clicking through your survey while testing? Adding some JavaScript to a bookmark can save you a ton of time! This tutorial will walk you through adding this bookmark to your browser.  First, create a new bookmark in your browser....
  6. sgapiURLValue(%%urlname)

    This function returns the value of a query string variable passed into the survey where %%urlname is the name of the url variable. Note: URL variable names are stored as all lower case in our system. Example This script outpu...
  7. Update Hidden Value If Question Answers Do Not Match

    We have a feature that will verify two textbox questions on the same page match (Example: Verify that the respondent enters the same email address twice).  This code snippet is used to check to see if the answers to any two questions in the surve...
  8. sgapiGetTableQuestionSkus(%%questionID)

    This function returns an array of skus for the given table. This can also be used to get the skus for the subquestions in Custom Groups. Example In this example we output the array of table question skus to the page. Check it out ...
  9. sgapiSetCustomTableValue(%%qID, %%rowname, %%value)

    This function allows you to set the value for an individual cell in a custom table question. Example The custom table has two rows and two column questions (one radio button and one textbox). In this example, we will pre-populate the ra...
  10. sgapiArraySet(%%array,%%index,%%string)

    This function sets the value of an item within an array. Example In the below example we change the value of textbox 10003 from a list of textboxes to 'Amelie'. %%movies = sgapiGetValue(5); %%foreign = 10003; %%value = 'Amelie'; sgapiArrayS...