# Any "change node" for JSON object

**URL:** <https://discourse.nodered.org/t/any-change-node-for-json-object/30661>\
**Category:** General\
**Created:** [24 July 2020 16:27 UTC](https://discourse.nodered.org/t/any-change-node-for-json-object/30661 "2020-07-24T16:27:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 July 2020 08:02 UTC](https://discourse.nodered.org/t/any-change-node-for-json-object/30661/4 "2020-07-25T08:02:46Z")

</div>

Hi firstly, please wrap flow and code in triple backticks ``` (the forum messes with code and it becomes unusable [see how to post code](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506))

> [@AK51](#):
>
> If there is a comma in excel, I want to change it to another character, or else, it will messy up the csv file

Why do you say that? As you can see in your debug output, the CSV is correctly formatted (i.e. the Name "Novak, John" is correctly surrounded with quotes because it has a comma.)

Secondly, why convert to CSV at all? As you have the values in a JS object (the first debug output) - you could simply pass that data straight to MySQL e.g...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/0637670ea93156ae6426fcb5e69e67f4af6c4e29.png)

Lastly - if you REALLY REALLY insist on changing a character in the name `property` of an the row `object` inside your `array` so you need to address each one - but - there could be an unknown amount of rows (i.e. the array size will be dynamic based on the spreadsheet content) - you will need to either loop through each row and modify each item.

This might be possible in JSONata but I dont know JSONata too well and if its a large array, standard JS loop will be much faster.

try adding a function node between the "sheet to json" and the "json to csv" node with the below...

```auto
//loop through each row 
// replace , with |   
// in the Name property 
// of each object in the array
for (let i = 0; i < msg.payload.length; i++) {
    msg.payload[i].Name = msg.payload[i].Name.replace(",","|")
}
return msg;

```

---

_[View the full topic](https://discourse.nodered.org/t/any-change-node-for-json-object/30661)._
