How do I save the payload of an HTTP POST request to Google Sheets?

This topic was automatically generated from Slack. You can find the original thread here.

Amadi Promise : I’m try to send a post request to pipedream HTTP / Webhook API

i want to store the body of the post request in spreedsheet

Please i will love your feedback, thanks in advance

Dylan Sather (Pipedream) : Hi , take a look at this example workflow.

I used the Payload Only source (under the HTTP / Webhook app) in this example. When you send a POST request to that source’s HTTP endpoint, you can reference the payload at the variable steps.trigger.event.body (read more about how to examine and reference the variables tied to incoming event data here).

Then, I added an action to Add a new row to a Google Sheet. In my example, I’m assuming you’re sending JSON data (you can modify the workflow if not), so I added {{ JSON.stringify(steps.trigger.event.body) }} as the value of the first element of the Columns param. Since this action adds a single new row to a sheet, Columns specifies the data you’d like to add in each column. It’s an array since you can add multiple columns in a single row. In my example, I’ve just got one column of data, but you can add multiple columns of data by pressing the + button to the right of the first element.

Then I just fill in the spreadsheet ID and sheet name (by default, Sheet1), and the workflow writes the HTTP payload to Google Sheets:

Screen Shot 2021-03-19 at 11.18.14 AM.png

Dylan Sather (Pipedream) : Let me know if that helps, or if you have any other questions

Amadi Promise : thanks for the reply, i appreciate