Popular Articles

  1. sgapiGetQuestionRuntimeProperty(%%questionID,%%property)

    This question returns the specified runtime property for the given question ID. Possible Properties Return Values Hidden boolean Required boolean Soft-Required ...
  2. 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...
  3. 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...
  4. 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....
  5. 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* %%...
  6. 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...
  7. 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...
  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. 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...
  10. 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...