Popular Articles

  1. sgapiCheckboxTotalChecked(%%questionID)

    This function returns the number of checkboxes selected for the given question. Example In the below example we get the total checked checkboxes and output it to the page. Check it out in an Example Survey %%output .= sgap...
  2. PHP Functions

    We've included many common PHP functions into our scripting language to allow you to achieve the functionality you desire. To learn more about PHP functions and programming, visit PHP Documentation . ...
  3. sgapiHidePage(%%pageID,true/false)

    This function hides or shows a page. Example In this example script we hide pages 3 and 4 by default by setting sgapiHidePage for these page IDs to true. Then, based on the answer to the jedi or sith question on page one we set the sgap...
  4. sgapiResultsQuestionTotal(%%questionID)

    This returns the cumulative sum of all the numeric values answered for the given question ID from responses that have already been processed . This function requires numeric reporting values. The sum that is returned will not include data from...
  5. sgapiDisqualify(%%message)

    This function disqualifies the user and ends the survey. %%message will display your customized message to the respondent. Example In this example, if the answer to question ID 2 is "no" and there are fewer than 3 answered questions on page ID 1,...
  6. sgapiStrtotime(%%string,%%time)

    This is equivalent to the strtotime function in PHP. This function takes %%string and converts it to a Unix timestamp. If the optional %%time is given it will convert it relative to %%time. See an example in our Age Verification by Birthd...
  7. sgapiSetQuestionRuntimeProperty(%%qID,%%property,%%value)

    This function sets the specified runtime property for the given question. Possible Properties Values Required true/false Soft-Required true/false Disabled tr...
  8. sgapiGetQueryResponseCount(%%urlname)

    This function returns the number of responses (completes) that have been collected for the current survey. It takes an optional %%urlname parameter that filters by a URL variable. %%name should be in the format of: "urlvar_VariableName=Value". ...
  9. sgapiDate(%%format,%%time)

    This is equivalent to the date function in PHP. This function converts %%time, a Unix timestamp, into a human readable date and time. %%time is optional and defaults to the current time. Check out the PHP documenation for this function to lea...
  10. sgapiSubmitSurvey()

    This function submits the data from the current page and records the response as a partial. All data from previous pages will be stored for reporting. Note: this will  not  submit the current page and move to the next. To do that, use sgapiJum...