How to prefill Zoho Forms with data from Zoho Sheet using webhooks

How to prefill Zoho Forms with data from Zoho Sheet using webhooks

Zoho Forms allows you to dynamically prefill form fields with data fetched from external sources. One popular use case is pulling customer data stored in a Zoho Sheet and pre-populating your forms when the user opens them. This feature is especially useful when you already have existing records, such as employee detail, stored in Zoho Sheet, and you want to prefill forms based on a unique identifier. You want employees to simply enter their Employee ID in a Zoho Form, and have the rest of their information like name, email, and department—automatically filled in from the Zoho Sheet.

Check out a quick video on how to configure this.


Lets assume you have a Zoho Sheet with the employee data below.


  1. In your Zoho Forms account, click Control Panel in the left panel.
  2. Under Developer Space, click Connections.

    Click Connections

  3. Click Create Connection.

    Create Connection

  4. From the list of services, choose Zoho Sheet.

    Choose Zoho Sheet

  5. Enter a Connection Name (ZohoSheet).

    Enter a Connection Name

  6. Under Scope, select ZohoSheet.data.API.READ. This allows Zoho Forms to read data from Zoho Sheet.

    Choose Scope

  7. Click Create and Connect. Grant permission when prompted, allowing Zoho Forms to access data from Zoho Sheet.

    Grant permissions

  8. Once connected, you can view the connection summary.

    Connection Summary

  9. Open your form builder, go to Settings > Form Settings > Prefill > Dynamic Prefill - Webhook.

    Go to Dynamic Prefill - Webhook
  10. Click Configure.

    Configure

  11. Under Webhook Settings:
    1. Search Field: Select the field that will be used to look up the record in your Zoho Sheet (for example, Employee ID).

      Pick your Search Field

    2. Webhook URL:
      1. Copy the Zoho Sheet API base URL from Zoho Sheet API documentation.

        Copy the API URL
      2. In your webhook configuration, paste this URL (https://sheet.zoho.com/api/v2/) in the Webhook URL field.



      3. Go to your Zoho Sheet, copy the Sheet ID from the URL, and append it at the end of the above link as https://sheet.zoho.com/api/v2/<sheetID>



        For example, if your Sheet ID is abcd1234efgh5678, the final URL will be: https://sheet.zoho.com/api/v2/abcd1234efgh5678

        Webhook URL
    3. Under Authorization Type, select Connection. From the list, choose the connection you created earlier for Zoho Sheet.

      Choose the connection you created

    4.  Add the following URL parameters that define how Zoho Forms should fetch and render your data.


      Parameter
      DescriptionInput
      criteriaThis tells Zoho Forms which column to search in your Zoho Sheet.
      In the Choose Field section, click Add Input Manually and type the column name (as in your Zoho Sheet) within quotes.
      For example, if your Zoho Sheet column is named
      ID, enter: "ID"=Then, choose the form field where the Employee ID is entered.
      worksheet_nameSpecifies the worksheet in your Zoho Sheet that contains the data.Copy the name of your worksheet from the Zoho Sheet. 
      methodInstructs Zoho Forms to fetch records from the sheet.
      Type:
      worksheet.records.fetch
      render_optionEnsures data is displayed in the same format as in Zoho Sheet.
      Enter custom input as formatted
URL Parameters

Test the webhook with search field value like 1001 and check if the received response is valid.

Test the webhook

Once the webhook test is successful, map each field from the JSON response to the corresponding form field. Click Save.

Map form fields to prefill

Now, when a respondent opens the form, enters their Employee ID and clicks the search icon, the form will call the Zoho Sheet, fetch details, and prefill the form automatically.

Employee enters the Employee ID

Form fields are prefilled