# New rows in google sheets are not adding up

**URL:** <https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736>\
**Category:** Integrator.io\
**Tags:** page-size, google-sheets\
**Created:** [June 17, 2022, 3:33pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736 "2022-06-17T15:33:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![moazamsaleem](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@moazamsaleem](https://connective.celigo.com/u/moazamsaleem)\
**Post date:** [June 17, 2022, 3:33pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736/1 "2022-06-17T15:33:51Z")

</div>

Hi @steinchu-SteinChu"\>@steinchu, I am trying to Add/update data in google sheets through put method like this way

 ![5301043caa20740200000001-03291a92c4e94db0b7423d7ccb185edd.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/5/5e1966f16751a3f43ad8601cbabfc092ee1860ce.png)

I have also fixed page size to 1. But still when I send request to google sheets it's just updating a single row.  
Can you suggest any work around to create/update multiple rows in google sheets.

---

<div class="post-metadata">

**Author:** ![steinchu](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@steinchu](https://connective.celigo.com/u/steinchu)\
**Post date:** [June 17, 2022, 4:22pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736/2 "2022-06-17T16:22:37Z")

</div>

hi @moazamsaleem522, What you have shown in your screenshot, and setting page size to 1 has worked in my tests. I think I'll need some additional info to understand your setup better. Can you join my zoom here? [https://zoom.us/j/234354427](https://zoom.us/j/234354427)

---

<div class="post-metadata">

**Author:** ![steinchu](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@steinchu](https://connective.celigo.com/u/steinchu)\
**Post date:** [June 17, 2022, 4:36pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736/3 "2022-06-17T16:36:51Z")

</div>

thanks for joining the call Moazam. The usecase you described is to update rows if they have the same id and add if there's a new id. I will be doing some tests on my end and will get back to you.

---

<div class="post-metadata">

**Author:** ![steinchu](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@steinchu](https://connective.celigo.com/u/steinchu)\
**Post date:** [June 17, 2022, 8:01pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736/4 "2022-06-17T20:01:34Z")

</div>

Update from our discussion, I could not figure out a way to find existing id and add new ids, but the alternate approach I shared was what was done here:

undefined

For NetSuite export, we added a presave script to combine the records into one array:

```
function preSavePage (options) { var itemArray = options.data; return { data: [{itemArray}], errors: options.errors, abort: false, newErrorsAndRetryData: [] }}
```

We also increased the page size to fit all the records in one page since there is currently a limitation for pre save page to execute per page.

Next step we cleared the google sheet:

```
v4/spreadsheets/xxxx/values/Sheet1:clear
```

Then last step, we save all the records in google sheet

```
{"values": [["id", "ItemName", "Quantity", "Price", "Location"],{{#each data.itemArray}}["{{id}}", "{{Name}}", "{{Qty}}", "{{Price}}", "{{Location}}"]{{#unless @last}},{{/unless}}{{/each}}]}
```

---

<div class="post-metadata">

**Author:** ![gabemontoya](https://avatars.discourse-cdn.com/v4/letter/g/779978/32.png) [@gabemontoya](https://connective.celigo.com/u/gabemontoya)\
**Post date:** [June 23, 2022, 5:43pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736/5 "2022-06-23T17:43:06Z")

</div>

Hi @steinchu, is this still your recommended way of importing NetSuite records into Google Sheets? I'm getting the same sort of errors.

When I use PUT without 'append' in the URI (if it's there it causes an error), only one line gets updated and overwritten.

When I use POST and add 'append' to the URI, I get different lines, but some of those lines get overwritten (I can watch it happen in real time).

Thank you!

---

<div class="post-metadata">

**Author:** ![steinchu](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@steinchu](https://connective.celigo.com/u/steinchu)\
**Post date:** [June 23, 2022, 9:56pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736/6 "2022-06-23T21:56:07Z")

</div>

hi @gabemontoya , I've tried a different approach that I think works better. Try this demo flow I created:

[https://drive.google.com/file/d/18GjxPv05CBq5QUtX2q-9vJ1766s2eqi7/view?usp=sharing](https://drive.google.com/file/d/18GjxPv05CBq5QUtX2q-9vJ1766s2eqi7/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![gabemontoya](https://avatars.discourse-cdn.com/v4/letter/g/779978/32.png) [@gabemontoya](https://connective.celigo.com/u/gabemontoya)\
**Post date:** [June 28, 2022, 11:45pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736/7 "2022-06-28T23:45:54Z")

</div>

Thanks for sharing @steinchu! I wasn't fully able to replicate, but was able to do some testing.

For some reason {{#each data.[0].itemArray}} gave me an error, while {{#each data}} did not.

However, I was able to resolve my issue of rows overwriting each other by setting page size to 1.

Thank you!

---

<div class="post-metadata">

**Author:** ![scotthenderson](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/scotthenderson/32/6780_2.png) [@scotthenderson](https://connective.celigo.com/u/scotthenderson)\
**Post date:** [October 19, 2023, 10:13pm UTC](https://connective.celigo.com/t/new-rows-in-google-sheets-are-not-adding-up/736/8 "2023-10-19T22:13:53Z")

</div>

We published a brand new template in our marketplace that makes it super easy to work with Google Sheets. We published a new article too explaining all the details ([here](https://docs.celigo.com/hc/en-us/articles/10031282236059-Working-with-Google-Sheets)). Hope this helps.
