Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
AssessmentResponses Class
Namespace
Usage
To save assessment responses from the runtime Omniscript on the Omni Assessment Task page to the AssessmentResponses class, implement the VlocityOpenInterface interface.
Specify the implemented Apex class name in the Remote Actions section of the OmniScript page. A Remote Action calls the specified Apex class and its method to save the assessment form in the Assessment and AssessmentQuestionResponse Salesforce objects.
This screenshot shows the Apex class name and its method as specified in the Omniscript Remote Action Properties section:
Special Access Rules
Public Sector and Dynamic Assessment permission sets are required to use this Apex class.
Example
1
2global class OmniSave implements <Vlocity_Namespace>.VlocityOpenInterface {
3 public Boolean invokeMethod(String methodName, Map<String,Object> input, Map<String,Object> output, Map<String,Object> options){
4 PublicSectrSltn.AssessmentResponses.storeResponses(input,output,options);
5 return true;
6 }
7}For more information on the VlocityOpenInterface interface, see OmniStudio Foundation Guide.
AssessmentResponses Methods
The following is a method for AssessmentResponses.
storeResponses(input, output, options)
Signature
public static void storeResponses(Map<String,Object> input, Map<String,Object> output, Map<String,Object> options)
Parameters
-
input:
Type: Map<String,Object>
Contains the context ID, assessment response in JSON format, and extra payload details from configurations from Vlocity OmniScript.
-
output:
Type: Map<String,Object>
Reserved for future use.
-
options:
Type: Map<String,Object>
Contains the assessment name and assessment status that are configured in OmniScript.
Return Value
Type: Void