The remote lookup field is a great way to get data from external systems into your form.
One of the most common use cases is getting a current currency exchange rate. For example, let’s say you want to convert a purchase order that was entered in USD into GBP.
In the Kissflow form, let’s start with a currency field called PO Value that shows the total price of the PO in USD.
Configuring the Remote lookup field
Add a remote lookup field called GBP Conversion Rate.
URL and Request type
In the URL field, enter the URL to direct toward the API.
In this example, we are going to get the conversion URL from CurrencyLayer, a 3rd party API. You can sign up for a free account at https://currencylayer.com/product.
Back in the Kissflow form, enter this link in the URL field:
The remote lookup allows you to do either a GET or POST request. This example is a GET.
Header and Body
Next, you can add HEADER and BODY parameters in the API request. This is useful when you are making authenticated calls to other API services.
In this example, we'll add the access key in the body. Click +Add Body, then in the name field type access key. In the value field, enter the actual access key. Find your access key in Step 3 of the Quickstart guide in CurrencyLayer. Note that with CurrencyLayer’s free account, your source currency will always be USD.
JSON path of value in result
To display the computed values in a specified format, enter this in the JSON path. These are specific to whichever URL you are calling.
In our case, the JSON path will be:
How should the result be chosen?
You can choose whether or not to display a dropdown, or autopopulate a response. For this example, we'll choose autopopulate.
The live form
In the live form, you’ll see a button for GET requests that says Get Data. Click the button and Kissflow will perform a remote call and fetch the live value.
In this example, we've also added a field to display the total calculated value in GBP. It is a number field with the formula:
PO_Value.value() * number(GBP_Conversion_Rate)
Extracting data with a remote lookup
You can also use a remote lookup field to extract data from an external API. Here are some examples
For example, I want to display the grocery items with periodic pricing from an external API in my form table.
Sample JSON that I want to extract:
"state": "Andhra Pradesh",
In the Kissflow form, let’s start with a remote lookup field called Item Name that shows the list of items within a table.
- Add an API link in the URL field.
- Then choose GET as the request type.
- Provide a Header name as Content-Type and Value as application/json.
- Enter a JSON path of value in result: In my case, it will be $.records[*].
- In the field, What kind of data are you working with? choose JSON.
- In the field, How should the result be chosen? choose Select a value from the dropdown.
Then add a currency field called Unit Price, with the formula:
In addition to currency rates, you can use the remote lookup field to:
- Get stock and bullion rates
- Refer to data on a different MDM system
Reduce the number of remote fields by storing the entire JSON/XML data from one call instead of just a particular value and using JSON_EXTRACT formula in other fields.