Configuring a Referenced Web Service |
Scroll |
A Referenced Web Service allows users to continuously retrieve data from a web service via REST, and to save it in a database table that can be used the same way as any other referenced table. Database access is not needed in order for this feature to work.
1.In the Thereforeâ„¢ Solution Designer, go to the Design object and right-click on Referenced Tables. Select the option 'New Referenced Web Service...'.
2.The first step is to configure the table the data from the web service should be saved in. Take a look at the JSON response sample from the documentation of the REST API you will be using to find out what the table should look like. Choose a unique identifier for the referenced table by checking the box in the left column.
3.Go to the 'Synchronization' tab and click 'Create a new REST request' to configure the REST call.
4.Give the REST call an intuitive name, and specify the method, and the API endpoint. Depending on the REST API you are using other configuration steps, such as authorization might be necessary.
5.Go back to the 'Synchronization' dialog to and click 'Test' to test the configuration.
6.Click 'Start' to run the REST call. Make sure everything is in order.
7.Go back to the Synchronization tab and map the data from the JSON response to the matching table columns. Click 'OK' to save the configuration.
8.You can check if the table was populated correctly by right-clicking on the Referenced Table and selecting the 'Delete Rows' option. This dialog also allows you to search the referenced table.
9.Now, the table can be directly referenced in a category. In this example, 'ID' is the unique identifier for the table so it is added as an invisible primary field. The other fields including data from the referenced table are dependent on ID.
10. When sending new documents to Thereforeâ„¢, we can now select public holidays from a list. This data is being kept up to date by the referenced web service running in the background.
11. In accordance with our configuration, more information about the holiday is automatically added from the referenced table.