How to use a webhook to export data
You can export data to an endpoint using our "Trigger Webhook" without writing a single line of code, in just one simple step. Looking for a guide on how to post data to Zapier, click Zap.
# How to start from scratch
First, build out your automation by adding the steps you need to generate the data you wish to export.
# Add and configure the "Trigger webhook" step
Using the "Step Finder", search for and add the "Trigger webhook" step, then follow the steps below to configure it.
https://www.youtube.com/embed/Q7O7QzaDS3I?si=yZCBxs_lPS-99tOB&start=779
How
- Open the Step Finder, search for "Trigger webhook," and add the step.
- Inside the "Endpoint" field, insert your URL.
- Click "Insert Data" and select the data you wish to post via the webhook.
- Click Run to send the data.
When a token is used and all columns are selected, the data is passed in as a 2D array. You will need to parse the array at the other end to extract the data into the format you require. See the example below:
[["A1", "B1", "C1"], ["A2", "B2", "C2"]]
# Custom configuring the payload
It is possible to configure the payload yourself. Remember, tokens are 2D arrays, and the format is JSON. However, the constraint of this method means only a single row of data can be sent per post request.
Below is an example of using tokens in a custom payload. For each token we have selected a column of data.
{
"request": "create_customer",
"customer": {
"first_name": "[google-sheet-data?all&1]",
"last_name": "[google-sheet-data?all&2]",
"email": "[google-sheet-data?all&3]",
"phone": "[google-sheet-data?all&4]",
"address": {
"street": "[google-sheet-data?all&4]",
"city": "[google-sheet-data?all&5]",
"state": "[google-sheet-data?all&6]",
"postal_code": "[google-sheet-data?all&7]",
"country": "[google-sheet-data?all&8]"
},
"company": {
"name": "[google-sheet-data?all&9]",
"job_title": "[google-sheet-data?all&10]",
"industry": "[google-sheet-data?all&11]"
},
"notes": "[google-sheet-data?all&12]"
}
}
# Test with an endpoint
You can test triggering a webhook using Webhook.site (opens new window) for free. Simply click on the link, then under "Request details", look for "Post", copy the URL, and insert it into your Trigger Webhook step as your endpoint. Perform a test run. You should see a preview of the raw content once the run is complete. See the image below:
# Learn More
Discover more in our API guides, including how to post data to a Zap in Zapier.