HotDocs Advance Workflow Download assembled documents

User Context Data Overview

User context data are answers Advance can automatically pass into an interview based on the user's account details.

For example, you can show or hide questions in an interview conditionally depending on the user's work group or whether it is a client interview

Overview

Advance stores useful information about users. This includes:

  • Personal details, such as their first name, last name, and email address.
  • Data about their Advance account, such as the work groups they belong to.
  • What kind of user they are, such as an external client.

User context data makes this information available inside an interview, using user context variables. You can use these variables in your template to populate answers and tailor an interview to specific users. When a user opens an interview, Advance populates the user context variables with the user's data. Template authors can use user context data to tailor a template's interview to a user, for example by showing conditional sections or assembling auxiliary templates. 

Creating a Template Using User Context Variables

To use the user context data, you must have a template using the available user context variables. The following sections of the HotDocs Author documentation may help you create a template with user context variables:

Workflow

The template author, working in HotDocs Author version 1.78 or later, creates a template which uses the user context variables. These must match the name and variable type of the user context variables provided. The template author can add additional functionality, such as conditional regions, to the template as desired. When a user opens an interview for the template in Advance, Advance overlays the user context data as answers to the variables. If configured in the template, Advance can use these answers to present a tailored interview, for example showing conditional sets of questions or assembling auxiliary templates.

Advance ensures only the data asked for in the template's interview is imported. This helps reduce file size and avoids unnecessary data being retained.

If you use the Custom Interview event or the Load Interview event webhook to connect to an external data source, Advance sends user context data in the request.

List of available variables

When authoring a template, you can choose to add any of the following variables to your template. Advance will only populate the variables you add to the template.

You must match the name and type of variable exactly.

User Context Variable Name Type Notes
HD_UserContext_IsClientInterview True/False Is the current interview a client interview.
HD_UserContext_ClientId Text Shows as "unanswered" if IsClientInterview is set to False
HD_UserContext_ClientTitle Text Shows as "unanswered" if IsClientInterview is set to False
HD_UserContext_ClientFirstName Text Shows as "unanswered" if IsClientInterview is set to False
HD_UserContext_ClientLastName Text Shows as "unanswered" if IsClientInterview is set to False
HD_UserContext_ClientEmailAddress Text Shows as "unanswered" if IsClientInterview is set to False
HD_UserContext_ClientMobileNumber Text Shows as "unanswered" if IsClientInterview is set to False.
HD_UserContext_ClientMobileNumberCountry Text Shows as "unanswered" if IsClientInterview is set to False
HD_UserContext_LinkData Text If the interview is opened from an Advance template link, this answer is populated with the value of the link's LinkData property. See Passing Linked Data in a Template Link Query String for more information.
HD_UserContext_TemplatePackageId Text The unique ID of the template in Advance.
HD_UserContext_TemplateName Text The name of the HotDocs template used by the interview.
HD_UserContext_TemplateVersionNumber Text The unique ID for a specific template version.
HD_UserContext_UserId Text The unique ID of the user currently using the interview.
HD_UserContext_UserFirstName Text The current user's first name.
HD_UserContext_UserLastName Text The current user's last name.
HD_UserContext_UserEmailAddress Text The current user's email address.
HD_UserContext_UserGroupIds Text List The list of unique IDs of the user groups to which the current user has access.
HD_UserContext_UserGroupNames Text List The names of the user groups to which the current user has access.
HD_UserContext_WorkItemName Text The name of the work item for which the current user loaded the interview.
HD_UserContext_WorkItemId Text The unique ID of the work item for which the current user loaded the interview.
HD_UserContext_WorkItemVersionId Text The unique ID of the specific work item version from which the current user has loaded the interview.
HD_UserContext_WorkGroupId Text The unique ID of the work group containing the work item being used by the current user.
HD_UserContext_WorkGroupName Text The name of the work group containing the work item being used by the current user.
HD_UserContext_SiteMoniker Text The unique identifying name of the Advance tenancy in which the current user has loaded the interview.

Common Reference Topics

Among others, the following reference topics may relate to this conceptual area: