SDK Reference v2.0.0 / SurveyAnswersQuery
SurveyAnswersQuery
Specifies filtering and page-navigation criteria for survey answers.
All query properties are optional. Set non-nil/non-default values only for the properties you want to use for filtering.
You can filter survey answers by two different types of dates: before/after
and insertedBefore/After
. The former properties use the date the answer was recorded by the participant; the latter ones use the date the answer was submitted to the system. The dates may be appreciably different if the participant started a survey, answered a few questions, and then submitted it much later. There may also be minor variations due to the participant’s device time compared to the server time. Use the insertedAfter
property to search for new answers since a prior query.
static let defaultLimit: Int
The default and maximum number of results per page.
let surveyResultID: SurveyResult.ID?
Auto-generated, globally-unique identifier for the survey submission containing the answer.
let surveyID: Survey.ID?
Auto-generated, globally-unique identifier for the survey containing the step the answer was provided for.
let surveyNames: Set<String>?
Filter by one or more internal names of the surveys which have the answers.
let after: Date?
Search for answers recorded by the participant after a specific date.
let before: Date?
Search for answers recorded by the participant before a specific date.
let insertedAfter: Date?
Search for answers submitted to the system after a specific date.
let insertedBefore: Date?
Search for answers submitted to the system before a specific date.
let stepIdentifiers: Set<String>?
Filter by one or more identifiers for the survey steps for which answers were submitted. Refers to the step identifier field in the MyDataHelps survey editor.
let resultIdentifiers: Set<String>?
Filter by one or more identifiers for the field on the survey step for which answers were submitted. Relevant for form steps, and refers to their form items’ identifier field.
let answers: Set<String>?
Filter by one or more specific text values the answer contains.
let limit: Int
Maximum number of results per page. Default and maximum value is 100.
let pageID: SurveyAnswersPage.PageID?
Identifies a specific page of survey answers to fetch. Use nil
to fetch the first page of results. To fetch the page following a given SurveyAnswersPage
use its nextPageID
; the other parameters should be the same as the original SurveyAnswersQuery
.
init(surveyResultID: SurveyResult.ID? = nil, surveyID: Survey.ID? = nil, surveyNames: Set<String>? = nil, after: Date? = nil, before: Date? = nil, insertedAfter: Date? = nil, insertedBefore: Date? = nil, stepIdentifiers: Set<String>? = nil, resultIdentifiers: Set<String>? = nil, answers: Set<String>? = nil, limit: Int = defaultLimit, pageID: SurveyAnswersPage.PageID? = nil)
Initializes a new query for a page of survey answers with various filters.
Auto-generated, globally-unique identifier for the survey submission containing the answer.
Auto-generated, globally-unique identifier for the survey containing the step the answer was provided for.
Filter by one or more internal names of the surveys which have the answers.
Search for answers recorded by the participant after a specific date.
Search for answers recorded by the participant before a specific date.
Search for answers submitted to the system after a specific date.
Search for answers submitted to the system before a specific date.
Filter by one or more identifiers for the survey steps for which answers were submitted. Refers to the step identifier field in the MyDataHelps survey editor.
Filter by one or more identifiers for the field on the survey step for which answers were submitted. Relevant for form steps, and refers to their form items’ identifier field.
Filter by one or more specific text values the answer contains.
Maximum number of results per page.
Identifies a specific page of survey answers to fetch.
func page(after page: SurveyAnswersPage) -> SurveyAnswersQuery?
Creates copy of this query for a page of results following the given page, with the same filters as the original query.
The previous page of results, which should have been produced with this query.