Skip to main content

How to Retrieve External Data into a Worksheet


In addition to passively receiving pushed data from external systems, you may also need to actively fetch data from third-party services via API requests.

Use Case Example

In the Contacts worksheet, after entering a customer's phone number, the system sends the number to a third-party API that retrieves mobile carrier location information. The returned location is then written back into the corresponding worksheet field.

How to Implement

  1. Create a Workflow Triggered by a Worksheet Event

    This workflow will be triggered when the phone number field in a Contacts record is created or updated.

  2. Add a “Send API Request” Node

    • Select Send custom request as the request type
    • Set the request method to GET
    • Enter the following API URL:
      http://apis.juhe.cn/mobile/get?key=4c80e35a4220b955a2932a38e6511e9e&phone=
    • Click Test API to verify if the request is working and inspect the returned data.
  3. Strip the Country Code Before Sending the API Request

    In this platform, phone numbers are stored with the +86 country code, which is not supported by this particular API. To handle this, add a Code Block node before the API request node to remove +86.

    The code inside the code block should look like this:

    output = {output: input.phone.slice(3)};

  4. Write the Location Info Back to the Worksheet

    Add an Update Record node to write the retrieved location info into the designated field in the worksheet.

  5. Publish the Workflow

    Click Publish to activate the workflow.

  6. Test the Workflow

    Edit a record in the Contacts worksheet and update the phone number field to trigger the workflow and validate the result.