# How to parse data to Google Sheets through Web API

**URL:** <https://community.thunkable.com/t/how-to-parse-data-to-google-sheets-through-web-api/4076568>\
**Category:** Web API's\
**Created:** [August 12, 2025, 1:54pm UTC](https://community.thunkable.com/t/how-to-parse-data-to-google-sheets-through-web-api/4076568 "2025-08-12T13:54:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![appirapire](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@appirapire](https://community.thunkable.com/u/appirapire)\
**Post date:** [August 12, 2025, 1:54pm UTC](https://community.thunkable.com/t/how-to-parse-data-to-google-sheets-through-web-api/4076568/1 "2025-08-12T13:54:43Z")

</div>

Hi! I would like to parse 28 data to Google Sheets, creating a new row, through Web API, because I need to calculate the distance between the values entered in the current row and the values stored in previous rows. I know there is built-in blocks to connect to Google Sheets, but I need to do some calculations and App Script is the appropriate way.

This is my script

function doPost(e) {

try {

const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“entries”);

const data = JSON.parse(e.postData.contents);

sheet.appendRow([data.field1, data.field2, data.field3, data.field4, data.field5, data.field6, data.field7, data.field8, data.field9, data.field10, data.field11, data.field12, data.field13, data.field14, data.field15, data.field16, data.field17, data.field18, data.field19, data.field20, data.field21, data.field22, data.field23, data.field24, data.field25, data.field26, data.field27, data.field28]);

return ContentService.createTextOutput(JSON.stringify({ result: “ok”, data: row })).setMimeType(ContentService.MimeType.JSON);

}

catch (error) {

```auto
return ContentService.createTextOutput(JSON.stringify({ result: "error", message: error.message })).setMimeType(ContentService.MimeType.JSON);

```

}

}

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/d/fd671c57bd0faf455356e347521f1666c78bbca2.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [August 12, 2025, 10:54pm UTC](https://community.thunkable.com/t/how-to-parse-data-to-google-sheets-through-web-api/4076568/2 "2025-08-12T22:54:08Z")

</div>

Welcome to Thunkable! What is and is not working? What is your question?
