Learning Objectives
At the end of this unit, you learn the following. Use the links to read more.
The system has an extended capability to interact with external services that employ APIs. These APIs are used for loading projects, users, customer details, and more. The External Service provides a simple way to define the base URL and authentication to use when making the request and retrieving data from the data source without having to enter commands or write any code.
Keep in mind that the implementation details vary based on your specific business requirements.
Identify the data fields needed from the External Service
Identify the Form Fields that should automatically prefill
Step 1: From Module Designer, open the module for which you want to configure the External Service
Step 2: Navigate to the External Services menu
Step 3: Click the Add new Service button
Step 4: Enter the following information:
Type: Choose the relevant type. Note that the system restricts editing the Type after you saved your record.
Field — Used within a Form field
Form — Used within a Workflow
Name: Key in a name that'll identify your endpoint API
Method: Select the HTTPS method that the endpoint API supports from the drop-down list. The selected method is used for making calls to the endpoint API.
Get
Post
Put
Patch
URL: Key in the base URL by including https:// of the target system
Authentication Type: Choose the Endpoint authentication to retrieve data from the data source. Available authentication types:
None — Select this option when authorization is not required to send request to the URL
Basic — For this type of authentication, user's credentials are used. Provide the Username and Password credentials for a user with permission to execute API requests on the target system.
Bearer — Gives access to the person who holds the token. Right-click in the Token field(Keyboard Shortcut: Ctrl+Shift+C in windows), choose Inspect Element, navigate to Application menu from the Inspector View and copy the token value into the field.
User MS Access Token — Currently uses bearer token
Step 5: Click the tabs and provide the relevant information that's needed to establish connection with the Form Fields for Autocomplete/Prefill
Request mapping
In the Source field, enclose the tenant id within quotes. For example: "irFYtkk". To pick the tenant id, Right-click in the Source field (Keyboard Shortcut: Ctrl+Shift+C in windows), choose Inspect Element, navigate to Network menu followed by Payload sub-menu from the Inspector View and copy the tenant value into the field. If you want to add project name or id, copy the custom name or id from the Form Builder field and paste in the Source field with the prefix ctx.mainForm.<name or id of the field>. For example: ctx.mainForm.v_name or ctx.mainForm.v_uniqueid
In the Target field column provide the Tenant id in the prescribed(prefix with body.) format. For example: body.projectname, body.projectid
Response mapping —
Response fields — Specify the fields used in Form Design to Set Controlling Records(Reference/Dependent Field) for Selection and Target field for Data Prefill
Configuration
Step 1: Navigate to the Forms menu and choose the Form in which you want to establish the External service connection from the List view.
Step 2: Open the Properties pane
Step 3: Drag and drop the AutoComplete and Autopopulate fields into the form.
Note: You set the selection and prefill criteria in the "Auto Complete" and "Autopopulate" properties
Step 4: Select the AutoComplete field and complete the following in the Auto Complete properties:
A. Name - Name for the field
B. Label - Display name of the field
C. Data Source type - From the Data Source type drop-down list, select the value as External Service
D. Data Source - From the Data Source drop-down list, select the value associated with the External Service. This data source is the name of the External Service.
E. Specify the label and value that you want to provide to the controlling record from the Field mapping Display and Value field drop-down lists. The Response Fields determined in External Service configuration displays in the the drop-down lists for selection.
Note: The Display field and Value field drop-down fields in the auto-complete properties determine the controlling records for selection based on which the data prefills into the target(dependent) fields.
[Optional] Turn on or off the Mandatory and Readonly fields as preferred.
Step 5: Select the ExtPopulate field and complete the following in the Auto Populate properties:
A. Name - Name for the field
B. Label - Display name for the field
C. Data Source type - From the Data Source type drop-down list, select the value as External Service
D. Data Source - From the Data Source drop-down list, select the value associated with the External Service. This data source is the name of the External Service.
E: Click on the Target Field drop-down list and choose which data prefills into this field. The Response Fields determined in External Service configuration displays in the the drop-down lists for selection.
Step 6: Save your setup
Now, complete data entry rapidly by creating a new form and selecting the reference field(configured through External Service) that automatically prefills the other form fields.
Step 1: Navigate to the custom form within the project
Step 2: Click the + Add New button to create new records
Step 3: Select the reference field value from the drop-down list and observe that the value of the dependent field are auto-completed(non-editable and greyed-out)
Step 4: Save your settings