How to Add '=EPOCHTODATE(timestamp,2)' to a Google Sheets Node Pulling Data from an Instagram Webhook Using Pipedream?

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

Hi , can i add this ‘=EPOCHTODATE(timestamp,2)’ to a node of google sheets that it is pulling data from a webhook of instagram?

This is the element in the ‘construct an array’ =“{{steps.trigger.event.body.entry[0].messaging[0].timestamp}}”

I am new at pipedream and at webhooks so please explain me from zero how this works and how can i get the desired output

Absolutely, I can walk you through how to convert a Unix timestamp (like the one you get from Instagram webhooks) to a readable date in Google Sheets using Pipedream. ## Step-by-step Guide ### 1. How Instagram Webhooks Send Timestamps Instagram (via Facebook/Meta webhooks) sends timestamps as Unix time (seconds since 1970-01-01). For example: steps.trigger.event.body.entry[0].messaging[0].timestamp This will be a number like 1718123456. ### 2. How Pipedream Passes Data to Google Sheets When you use Pipedream to send data to Google Sheets, you can map fields from your webhook (like the timestamp) directly into columns in your sheet. ### 3. How to Convert the Timestamp in Google Sheets You want to use the formula =EPOCHTODATE(timestamp,2) in your sheet, but Google Sheets does not have a built-in EPOCHTODATE function. Instead, you can use: excel =(((A2/60)/60)/24)+DATE(1970,1,1) Or, more simply: excel = A2 / 86400 + DATE(1970,1,1) Where A2 is the cell with your Unix timestamp. ### 4. How to Set This Up in Pipedream #### A. Set up your workflow: - Trigger: Webhook (Instagram sends data here) - Action: Google Sheets → Add Single Row #### B. Map the timestamp field When configuring the “Add Single Row” action: - For the timestamp column, use the expression: {{steps.trigger.event.body.entry[0].messaging[0].timestamp}} #### C. In your Google Sheet: - Suppose your timestamp is in column A (let’s say A2). - In column B (or wherever you want the readable date), enter the formula: excel =A2 / 86400 + DATE(1970,1,1) - Format column B as “Date” (Format → Number → Date). #### D. (Optional) Automate the formula - If you want the date to appear automatically, you can use an ARRAYFORMULA: ```
excel =ARRAYFORMULA(A2:A / 86400 + DATE(1970,1,1))

My question was if i can add the format directly in the workflow, instead of in my google sheets