You are here:
setSurveyFlowJson Function
Saves survey results to the database for the current presentation and visit when a field user saves or submits the related visit.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise and Unlimited Editions with Life Sciences Cloud, Life Sciences Cloud for Customer Engagement Add-on license, and the Life Sciences Customer Engagement managed package. |
When called, this function:
- Validates that the response object contains a
fullNameproperty, or returns an error for invalid response data. - Processes the stored survey data, and saves it to the database when a field user saves or submits the related visit.
- Creates related survey records.
The surveyflowjsonpassedtovisit event is triggered when the user selects the
Visit button to return to the visit page, not when a user finishes the survey response.
Syntax
PresentationPlayer.setSurveyFlowJson(Object, state)Parameters
| Argument | Description |
|---|---|
Object |
Required. A survey response JSON object that includes the fullName,
which is the full developer name of the survey, and other survey response data and
answers. |
state |
Optional. The submission state of the survey response. Supported values are:
The default value is |
Usage
Calling the function with the save state creates these survey records.
- A survey invitation record for the responded survey.
- A survey subject record.
- The subject ID is set to the current context, such as the visit ID.
- The parent ID is set to the new survey invitation record's ID.
- A survey engagement context record.
- The context type is set to Presentation.
- The context value is set to the presentation ID.
- The survey invitation ID is set to the new survey invitation record's ID.
- A survey response offline record.
- The response is set to the survey response JSON data.
- The survey invitation ID is set to the new survey invitation record's ID.
Calling the function with the submit state creates these survey records.
- All of the records that are created by the
savestate. - Survey question response records for each question response.
Did this article solve your issue?
Let us know so we can improve!

