NexJ Logo

Binding and syncing questions

You can bind questions to fields from an associated object or global property. The form will update the associated object in your application model.

Ensure that you have deactivated the template. You cannot modify active templates.

A user can run a business process to update information or to fill in missing details about a contact, company, or opportunity. To save users from having to fill out questions where the corresponding information has already been entered, you can bind questions to fields from the contact, company, or opportunity record.

To bind a question, use the Bound to field when you add or edit the question. In the Bound to field, you select a field from the contact, company, or opportunity record that matches the question's type.

For example, when you bind a Date Selection question, you choose from a list of date fields in the contact record, such as birthTime. When a user runs the business process, the answer to the Date Selection question populates with the date from the contact's birthTime field. If the birthTime field is empty, then the answer field for the Date Selection question remains blank, which can indicate to the user that they need to enter a date of birth.

After information from a contact, company, or opportunity record populates a bound question, users can make changes to this information in the form. These changes will not update the contact, company, or opportunity record unless you select Sync Back to Model for the question. Sync Back to Model becomes available after you bind a question. You can select this option to specify that the changes to the field will be written back to the contact, company, or opportunity record when the business process and approvals are complete.

If a page contains a question that synchronizes to a contact, company, or opportunity record field, creating two instances of the page in a flow also creates two instances of the question. The answer to the second instance of the question will then overwrite the first instance because both are synchronizing with the same contact, company, or opportunity record field. You must create a new page, or a copy of the existing page, where the synchronizing question is bound to a different contact, company, or opportunity record field.

To bind and sync a question:

  1. In the business process or call script template, edit the page in which you want to bind a question. The Edit Page dialog opens.
  2. In the Sections area, select the section in which you want to bind a question. A list of all questions in the section is displayed in the Questions area.
  3. Click the Action button for the question you want to bind, then select Edit. The Edit Question dialog opens.
  4. To bind questions fields to an associated object or global property:
    1. In the Bound to field, click the Select button . The Field Picker dialog opens.
    2. Select your desired field through either the associated object or global properties.
    3. Click OK. The Field Picker dialog closes.

    The selected field name populates the Bound to and Reference Name fields.

    For more information about global properties, see Adding global properties.

  5. [Optional] To specify that changes made to the bound question will update the associated objects in the application model, select Sync Back to Model.

    Sync Back to Model is only available for associated objects and not for global properties.

  6. [Optional] To display an indicator beside the bound question when its value is changed, select the Indicate updates option. If selected, when the value is changed, an asterisk is displayed beside the question and the old value is displayed below it.
  7. Click OK to save your changes to the page. The Edit Question dialog closes.

The question is bound to a field in the associated object or global property.

Examples of binding and syncing questions

The following examples illustrate how you can use binding and syncing to populate questions in a form with values from a contact record, and write values to the contact record from a form.

Basic example of binding and syncing questions

An administrator develops a business process that will be used to update client names. The administrator has the following requirements:

  • The form should have two text fields for the client's old first and last names, and two text fields for their new first and last names.
  • When the business process runs, the old first name and last name fields in the form should populate with the current names from the contact record. When the business process is approved, the first name and last name fields in the contact record should update with the new first and last names entered into the form.

The administrator creates a new business process template named Change of Name and adds a form with page that contains two sections. The sections are named Old Name and New Name.

In the Old Name section, the administrator adds two Single-line Text questions named First Name and Last Name. In both questions, the Bound to field binds the questions to the contact record's firstName and lastName fields respectively. When the business process runs, the answer fields for the questions populate with the current first and last names from the contact record. The administrator does not want changes made in first name and last name fields to update the contact's profile when the business process is approved, and clears Sync Back to Model for both questions.

In the New Name section, the administrator adds two Single-line Text questions called First Name and Last Name. In both questions, the Bound to field binds them to the contact record's firstName and lastName fields respectively. The administrator selects Sync Back to Model for both questions to update the first name and last name fields in the contact's profile when the business process is approved.

Advanced example of binding and syncing questions

An administrator develops a business process that will be used to specify or update a client's spouse. The administrator has the following requirements:

  • The form should have a selection field to choose an existing contact as the client's spouse, and two text fields for the spouse's first and last names.
  • If the contact has a spouse specified, when the business process runs, it should populate the spouse selection, first name, and last name fields in the form with the spouse's information from the contact record. When the business process is approved, if changes were made to the first name or last name fields in the form, the first and last name should update in the spouse's contact record.

  • If the contact does not have a spouse specified, when the business process runs, the user can choose an existing contact as the client's spouse. The business process should then populate the first name and last name fields in the form with the spouse's information from the contact record. When the business process is approved, if changes were made to the first name or last name fields in the form, the first and last name should update in the spouse's contact record.
  • If the contact does not have a spouse specified, and a contact for the client's spouse does not yet exist in the system, the user can enter the spouse's first and last name into the text fields in the form. When the business process is approved, it should create a new contact using the first and last names from the form. The new contact should then be set as the client's spouse.

The administrator creates a new business template named Update Spouse and adds a form with one page and an empty section. In the section, the administrator adds an Object Selection question named Spouse. The Bound to field binds the question to the contact record's Spouse field. When the business process runs, if a spouse is specified in the contact's profile, the answer field for the question populates with the spouse's record. If the user selects a different spouse, the administrator wants contact's profile to update with the new information, and selects Sync Back to Model.

Next, the administrator adds two Single-line Text questions named First Name and Last Name. In both questions, the Bound to field binds the questions to the spouse's firstName and lastName fields respectively. When the business process runs, if a spouse is specified in the contact's profile, the answer fields for the questions populate with the first and last names from the spouse's profile.

If a spouse is not specified in the contact's profile, the user can select one using the Spouse field. When they select a spouse, the administrator wants the spouse's first and last names to populate the First Name and Last Name fields in the form. To configure the questions to do this, the administrator creates expressions in the Field Control tab for each question.

For the First Name question, in the Value tab, the administrator enters the expression$CURRENT_PAGE.cf__SPOUSE.firstName, where cf__SPOUSE is the name of a custom field associated with the contact. In the Enablement tab, enter the expression TRUE.

For the Last Name question, in the Value tab, the administrator enters the expression$CURRENT_PAGE.cf__SPOUSE.lastName. In the Enablement tab, enter the expressionTRUE.

If changes are made in the First Name and Last Name fields in the form, the administrator wants the spouse's profile to update when the business process is approved, and selects Sync Back to Model for both questions. Sync Back to Model also specifies that, if no spouse is selected in the form, but the First Name and Last Name fields are filled in, when the business process is approved, a new contact is created using the first and last names from the form. This contact will then be set as the client's spouse.

Configuring pages
Activating business process templates
Adding questions
Field controls