> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/api/api-google-sheets-sending-lead-data-to-google-sheets.md).

# API - Google Sheets - Sending lead data to Google Sheets

Step-by-step guide on how to send SprintHub data to a Google Sheets spreadsheet.

{% embed url="<https://www.youtube.com/watch?v=4Fjqv79oU7I>" %}

#### SCRIPT FOR APPSCRIPT

```javascript
function doPost(e) {
    var sheet = SpreadsheetApp.openById("ID_DA_SUA_PLANILHA").getSheetByName("Sheet1");
    var data = JSON.parse(e.postData.contents);
    
    sheet.appendRow(data.values[0]);
    return ContentService.createTextOutput("Success").setMimeType(ContentService.MimeType.JSON);
}
```

#### JSON TO SEND THE SPRINTHUB DATA

```json
{
  "values": [
    [
      "{contactfield=firstname}", "{contactfield=lastname}", "{contactfield=email}", "{contactfield=mobile}"
    ]
  ]
}

```

**Conclusion:**

With these instructions, you'll be ready to send any data available via the SprintHub token into a Google Sheets spreadsheet, via an Automation Flow or any other automation block, whether from CRM or even via Chatbot.
