Article published on the 27th of June, 2024.
The contents of this article may be subject to change due to ongoing development of the WorkPoint Automate product.
Contents
1. Introduction
2. Options
1. Introduction
In this article we will discuss the options for setting up data binding to an HTTP endpoint on a field in WorkPoint Automate.
Binding a field to an HTTP endpoint in WorkPoint is very useful for getting data from a endpoint and use it, for example to fill in a form based on a search query.
A common example would be to look up a company in some database based on a unique identifier such as VAT number, and use the data returned by the endpoint to automatically fill in all necessary information for registering the company in WorkPoint.
For demonstration purposes, we have configured a HTTP endpoint in the HTTP Endpoint Library in WorkPoint. This endpoint allows us to search for companies in Denmark using the unique identifier CVR number.
2. Options
To set up an endpoint data binding for a field, we need to access that field's options on a WorkPoint Automate step. In this instance, we have an Entity Form step, and have expanded the options for the "CVR" field:
- To set up data binding to our endpoint on the CVR field, we click the "Data source" button.
This opens the Data binding panel:
Here, we can fill in a title for the configuration, and select the type of data binding we would like to use:
When we select "Endpoint", the panel is expanded with several additional options:
- In the "Endpoint" field, you can select which endpoint configuration from the HTTP endpoint library you want to use for the specific field.
When an endpoint is selected, any parameters defined for the endpoint in the HTTP endpoint library will appear. Each parameter has the following options:
- In the "Title" field, you can provide a display title for the parameter, which will be shown in the endpoint search side panel.
Note that if the type of the parameter is set to "Default", the title will not be shown.
- In the "Description" field, we can type in a help text, which will be displayed inside the search field in the search side panel until a user types something into the field. This could e.g., be a description of how the parameter should be used.
- In the "Type" field, we can define how we want the field to be displayed and how it should behave. The choices are:
- Text: A simple text field is displayed in which users can type in a search query.
- DateTime: A calendar is displayed when the field is focused in which the user can pick a date.
- Boolean: A toggle control is displayed in which the user can select either Yes or No (true or false).
- Choice: If selected, the parameter is shown as a drop down with choices according to the additional "Choices" field.
- MultiChoice: If selected, the parameter is shown as a drop down with choices according to the additional "Choices" field. Multiple selections can be made.
- In the "Display" field, we can select the display type of the parameter. Choices are:
- Default: If selected, the parameter will be the default parameter, and the search query can be passed into the field itself in the form, or in the default search box in the top of the search panel. Note that you can have multiple parameters set as "Default" display type, in which case, either search query can be made in the field or the default search box.
- Pinned: If selected, the parameter will be displayed just below the default search box in the search panel. Parameters set as "Pinned" will always be displayed and cannot be hidden.
- Additional: If selected, the parameter will be displayed inside an expandable and collapsible "Additional filters" group. Parameters set as "Additional" can thereby the displayed or hidden by expanding or collapsing the "Additional filters" group.
- In the "Value" field, we can provide a default value for the parameter.
- In the "Query conditions" field, we can define a condition we want to use for the query. The endpoint you have defined will not be queried until the input fulfills the query condition. An example query condition could be:
length(SearchQuery.Default) == 8
This specific query condition ensures that our endpoint only will be queried if we input 8 characters in the "Default" search bar.
- In the "Query conditions message" field, you can type a message which will be presented to the user until their query fulfills the query condition(s). For example, we could provide the message "CVR should be 8 digits long".
- The "Filter" field can be used to filter the returned results from the endpoint.
- In the "Error message" field, you can type an error message which will be displayed to the user if an error is returned from the endpoint. You can either type in a static message, or create a dynamic message, e.g., depending on the StatusCode parameter in the "Error" context object.
- Toggling the "Multiselect" option sets whether the user can select multiple items returned by the endpoint.
- The "Path" field can be used to specify from where the selectable properties in the "Value property", "Title property" and "Description property" fields should begin. If the selected endpoint returns a large object, but you are interested in data inside a single sub-object, you can select that object in the "Path" field. In the "Value property", "Title property" and "Description property" fields, you will then only be able to select from that object downwards.
- In the "Value Property" field, you can select which value from the endpoint to put into the field when a result is selected.
- In the "Title Property" field, you can select which value from the endpoint to use as the title of the search result. When using the endpoint, the selected property value will be displayed as the first text, signaling the title of the result,as shown here:
- In the "Description Property" field, you can select which value from the endpoint to use as a description text, which appears just below the title of search results, as shown in the a image above.
- Toggling the "Typeahead" option enables or disables typeahead. Typeahead makes it possible for the system to start searching when the user has input a small set of characters instead of having to wait for a full query and the push of a search button.
- If the "Link typeahead with panel" option is enabled, search results returned by the endpoint will be displayed both under the field itself and in the endpoint search side-panel, as shown in the following image:
- The "Disable panel opening on focus" option sets whether the endpoint search side-panel should open when a field which has an endpoint data binding is selected.
- By clicking the "Add tab" button, you can create tabs from where other endpoint configurations can be executed on the same field. An example of use could be if the endpoint we had access to could return companies from different countries depending on a specified country code provided. In that instance, we could e.g., create different tabs for executing the same endpoint but using different country codes, resulting in each tab being used for looking up companies in different countries. The configuration options for each tab are the same as the previously mentioned options in this section of the article.
Comments
0 comments
Please sign in to leave a comment.