Getting Unanswered Interview Variables
You can get the unanswered variables in interview templates using the HotDocs Advance API. This enables you to retrieve the variables that a user has chosen not to answer.
This is useful as it enables you to decide how to handle your work item. For example, if Advance returns your assembled documents with all variables answered, you may decide to change the workflow status to Complete. If Advance returns your assembled documents with unanswered variables, you may decide to set the workflow status to Rejected and begin a new version of the work item.
To get unanswered interview variables
To get unanswered interview variables, you must use the following endpoint:
GET /WorkItems/{workItemId}/Documents/{documentId}
Metadata Sent from Advance to your Endpoint
Any unanswered variables from an assembled document display in the metadata under assemblyResults in the JSON response.
Example JSON Response Data
{
"documentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workItemVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"templatePackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"templatePackageVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"assembledOrder": 0,
"name": "string",
"fileName": "string",
"type": "string",
"createdDate": "2024-06-26T11:49:29.385Z",
"hasContent": true,
"postProcessedBy": {
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"fullName": "string"
},
"isHidden": true,
"assemblyResults": {
"allReferencedVariablesAnswered": true,
"unansweredVariables": [ "string" ]
},
"urls": { "documentContentUrl": "string" }
}
If all interview variables are answered, the allReferencedVariablesAnswered property will return a value of true.
If you attempt to retrieve unanswered variables from documents assembled in versions of HotDocs Advance prior to 1.31.1, the AssemblyResult's will return a value of null.
Related Topics
- API Overview
- Work Items Overview
- Interview Overview
- Templates Overview
- Using the Post-assembly Processing Event Webhook to Modify Documents