How to get external data to a worksheet
For data from external systems, in addition to receiving data from external numbers, it is sometimes necessary to request data from external systems.
Use Case
After a customer's cell phone number is added to the Contact worksheet, get the city to which the cell phone number belongs through the interface, and then write it to a field in the worksheet.
Workflow Configuration
Create a workflow
The workflow is triggered when a cell phone number field is added or updated.
Add [Send API Request] node
Select [Send a custom request]
Select [GET]
API URL: http://apis.juhe.cn/mobile/get?key=4c80e35a4220b955a2932a38e6511e9e&phone=
Click [Test API]. If the request is successful, it gets the following list of parameters.
Since the phone number is stored with +86 which is not supported by the API, so remove the +86 via the code block node first.
Add a [Code Block] node before the [Send API Request] node, and select the Javascript. The configuration is as follows:
The code in the code block node is as follows for removing the first three characters +86 from the cell phone number and outputting it.
output = {output: input.phone.slice(3)};
Write the city to which the cell phone number belongs to the worksheet.
Add the [Update Record] node to write the obtained information to the field.
It can be a combination of province and city.
Publish the workflow
Modify the cell phone number field of a record in the worksheet to test.
Have questions about this article? Send us feedback