# Run Once from Function Node to Google Sheet Node -Array To String

**URL:** <https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906>\
**Category:** Questions\
**Tags:** core, data-transformation, node, workflow-building\
**Created:** [October 20, 2022, 9:10pm UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906 "2022-10-20T21:10:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_Tong](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/victor_tong/32/16142_2.png) [@Victor\_Tong](https://community.n8n.io/u/Victor_Tong)\
**Post date:** [October 20, 2022, 9:10pm UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/1 "2022-10-20T21:10:30Z")

</div>

Try to figure out how to convert the array to String to make sure all the Key match in the Google Sheet

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/4/2/42218ab0c7c9e1c80573e906fe7401ef7f300625.jpeg)

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/3/d/3ded97889714064df2e7ea4c68b7ff40c42a969e.png)

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 21, 2022, 8:13am UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/2 "2022-10-21T08:13:04Z")

</div>

Hey @Victor_Tong,

Are you trying to put all that data into the consignment entries field or add them as new field items?

---

<div class="post-metadata">

**Author:** ![Victor\_Tong](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/victor_tong/32/16142_2.png) [@Victor\_Tong](https://community.n8n.io/u/Victor_Tong)\
**Post date:** [October 21, 2022, 3:57pm UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/3 "2022-10-21T15:57:50Z")

</div>

I think it just flat it to string to save it into Google Sheet.  
Since Google Sheet do not handle , array in a single cell

---

<div class="post-metadata">

**Author:** ![Victor\_Tong](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/victor_tong/32/16142_2.png) [@Victor\_Tong](https://community.n8n.io/u/Victor_Tong)\
**Post date:** [October 21, 2022, 4:06pm UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/4 "2022-10-21T16:06:19Z")

</div>

Everything else is working perfectly.

The key match the json, just the array in consignment need to be flat into pure string, rather than object object

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/f/d/fdb48fe2a4d4c1dd3715183e373e67a9313ac511.jpeg)

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/8/c/8c2a41e1de510fd16cb7cb5ff6a9787811da6098.jpeg)

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 21, 2022, 4:11pm UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/5 "2022-10-21T16:11:59Z")

</div>

Can you share the json output of the node before the google sheet node?

---

<div class="post-metadata">

**Author:** ![Victor\_Tong](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/victor_tong/32/16142_2.png) [@Victor\_Tong](https://community.n8n.io/u/Victor_Tong)\
**Post date:** [October 21, 2022, 4:52pm UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/6 "2022-10-21T16:52:12Z")

</div>

Thanks mate

```auto
[

{

"consignmentCode":177243790,

"consignmentStatus":"ORDER_COMPLETE",

"orderId":"H2209040XXXXXXXXXX",

"orderDate":"2022-09-04 02:15:42",

"trackingId":5720437904,

"transactionId":"15481123719086096-3659485219_20220904021541",

"pickUpDate":"2098-01-01 11:00:00",

"deliveryDate":"2098-01-01 14:00:00",

"deliveryMethod":"merchant-delivery",

"consignmentEntries":[

{

"skuId":"H9202001_S_SLAD0008",

"skuNameEn":"Extended Color Candle Smart Light Bulbs E14",

"skuNameZh":"Extended Color Candle Smart Light Bulbs E14 白光彩光蠟燭智能燈膽",

"brand":"ADUROSMART ERIA",

"quantity":3,

"totalPrice":990

}

],

"syncTime":""2022-10-22T00:48:12.688+08:00""

},

{

"consignmentCode":177254843,

"consignmentStatus":"ORDER_COMPLETE",

"orderId":"H22XXXXXXXXXXX",

"orderDate":"2022-09-04 10:11:45",

"trackingId":5720548439,

"transactionId":"15481123719086096-3641741684_20220904101144",

"pickUpDate":"2098-01-01 11:00:00",

"deliveryDate":"2098-01-01 14:00:00",

"deliveryMethod":"merchant-delivery",

"consignmentEntries":[

{

"skuId":"H9202001_S_Bruno_BAK801_WH",

"skuNameEn":"BRUNO Instant Hot Water Dispenser White 即送冰川纹玻璃杯❄",

"skuNameZh":"BRUNO 即熱飲水機 純白色 香港行貨 即送冰川纹玻璃杯❄",

"brand":"BRUNO",

"quantity":1,

"totalPrice":998

}

],

"syncTime":""2022-10-22T00:48:12.688+08:00""

}

]

```

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 24, 2022, 10:07am UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/7 "2022-10-24T10:07:10Z")

</div>

Hey @Victor_Tong,

One thing you could do is use a set node to tweak the data you want to send and for the consignment entries you can use `{{ JSON.stringify($json["consignmentEntries"]) }}` the workflow example below seems to result in the data being saved to the sheet.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/4/3/43891b3cc51db1dc30cf4bdcd361e5d0261d9e2b.png)

---

<div class="post-metadata">

**Author:** ![Victor\_Tong](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/victor_tong/32/16142_2.png) [@Victor\_Tong](https://community.n8n.io/u/Victor_Tong)\
**Post date:** [October 25, 2022, 2:45pm UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/8 "2022-10-25T14:45:38Z")

</div>

Thanks Jon

May I ask what is the best practice for working rest of them field?

This take care of consigmentEntries?

```auto
{{ JSON.stringify($json["consignmentEntries"]) }}

```

I have to do a SET node for Google Sheet?

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 25, 2022, 3:48pm UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/9 "2022-10-25T15:48:34Z")

</div>

Hey @Victor_Tong,

You got it, It is probably best to use a set node for all the fields. This will change soon when the overhaul of the Google Sheets node comes out though so you will be able to set it in the node rather than needing the extra step.

---

<div class="post-metadata">

**Author:** ![Victor\_Tong](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/victor_tong/32/16142_2.png) [@Victor\_Tong](https://community.n8n.io/u/Victor_Tong)\
**Post date:** [October 29, 2022, 7:35am UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/10 "2022-10-29T07:35:51Z")

</div>

Great news, everyone is depending on google sheet those days  
Thanks Jon

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [November 5, 2022, 7:36am UTC](https://community.n8n.io/t/run-once-from-function-node-to-google-sheet-node-array-to-string/18906/11 "2022-11-05T07:36:01Z")

</div>

Closed on November 5, 2022, 7:36am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
