Get Assessment Response Summary
Get Assessment Response Summary makes it easy to use a flow to trigger server-side document generation by using Docgen.
In Discovery Framework, the responses from an assessment are stored in the AssessmentQuestionResponse object and the form metadata stays in Omniscript. You can use this invocable action to pass assessment summary data to the downstream processes. This invocable action provides a summary JSON that can be consumed in Docgen workflows to generate documents.
The Get Assessment Response Summary invocable action takes assessment ID as the input to get the OmniProcess ID, which is used to retrieve the OmniProcess elements. The assessment ID also retrieves the assessment response and merges the response with the OmniProcess elements to create an assessment summary response in JSON.
This object is available in API version 56.0 and later.
URI: /services/data/v56.0/actions/standard/getAssessmentResponseSummary
Formats: JSON
HTTP Methods: POST
Authentication: Authorization: Bearer token
| Input | Type | Description |
|---|---|---|
assessmentId | ID | Required. The ID of the assessment record for which to summarize responses. |
| Output | Type | Description |
|---|---|---|
assessmentResponseSummary | string | A JSON string containing the summary assessment question texts and responses for the specified assessment record. The response summary structure follows the structure of the Omniscript. If you turn on Multi-Language Data Translation for Discovery Framework, Salesforce translates the summary based on the AssessmentLanguage field on the Assessment record. Question labels are returned in the assessment language. For Multiselect, Radio, and Select questions, predefined option values are returned in the assessment language if translations are available. Free-text response values (Text, Text Area, Number) are returned exactly as entered and aren’t translated. |
Sample Input
When exposing the Get Assessment Response Summary invocable action in a REST API, you can use the following format to pass input, which includes the assessmentId and its value.
Sample Output
In this example, the first line indicates the Omniscript type, subtype, and language. For each step, there are multiple questions that appear in the Omniscript. You can use this information in a downstream process, such as generation of PDF document by using Docgen capability.
Sample Output with Data Translation
When you turn on Multi-Language Data Translation and a user submits the assessment in Spanish, the summary returns translated question labels and predefined option values. In this example, the question labels appear in Spanish, and Salesforce translates the Gender picklist value (Female becomes Mujer). Free-text values, such as Full Name and Email Address, remain exactly as entered.