# Import and merg JSON data with APOC

**URL:** <https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354>\
**Category:** Neo4j Graph Platform\
**Created:** [October 27, 2019, 9:29am UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354 "2019-10-27T09:29:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tideon](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/tideon/32/4351_2.png) [@tideon](https://community.neo4j.com/u/tideon)\
**Post date:** [October 27, 2019, 9:29am UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354/1 "2019-10-27T09:29:19Z")

</div>

Hello Everyone,

I can't figure out what I am doing wrong.  
I am attempting to create the following import but receive the following error (see attachment):

CALL apoc.load.json("file:/users/james/Desktop/desktop/keepa/Product\_Finder.2019\_10\_12\_Cleaned.json") YIELD value  
WITH value AS v  
MERGE(t:Toy {ASINnr:v.ASIN})  
SET t.ProductName = v.Title,  
t.Height = v.'Item: Height (cm)',  
t.Length = v.'Item: Length (cm)',  
t.Width = v.'Item: Width (cm)',  
t.Dimension = v.'Item: Dimension (cm³)',  
t.modelNr = v.Model,  
t.Category = "Toys & Games",  
t.SalesRank = v.'Sales Rank: Current',  
t.Weight = v.'Item: Weight (g)',  
t.Brand = v.Brand  
RETURN t

 ![40](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/7/797f2ba8c9152657e66b02501fc98496fede305d.png)

---

<div class="post-metadata">

**Author:** ![stefan.armbruster](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/stefan.armbruster/32/74_2.png) [@stefan.armbruster](https://community.neo4j.com/u/stefan.armbruster)\
**Post date:** [October 27, 2019, 2:23pm UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354/2 "2019-10-27T14:23:54Z")

</div>

does it work if you use subscript notation:

```auto
....
t.Length = v['Item: Length(cm)'], 
...

```

(of course for all accesses on `v`) ?

---

<div class="post-metadata">

**Author:** ![tideon](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/tideon/32/4351_2.png) [@tideon](https://community.neo4j.com/u/tideon)\
**Post date:** [October 27, 2019, 2:30pm UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354/3 "2019-10-27T14:30:45Z")

</div>

Hello Stefan,

I tried as you said and got the exact same error.  
Also where can read more about subscript notations in Neo4j?  
I am new to Neo4j (3-4 months)

Thank you for responding.

Kind regards

---

<div class="post-metadata">

**Author:** ![mark.needham](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mark.needham/32/104_2.png) [@mark.needham](https://community.neo4j.com/u/mark.needham)\
**Post date:** [October 28, 2019, 1:59pm UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354/4 "2019-10-28T13:59:08Z")

</div>

Can you try replaced the single quotes with back ticks?

```auto
CALL apoc.load.json("file:/users/james/Desktop/desktop/keepa/Product_Finder.2019_10_12_Cleaned.json") YIELD value
WITH value AS v
MERGE(t:Toy {ASINnr:v.ASIN})
SET t.ProductName = v.Title,
t.Height = v.`Item: Height (cm)`,
t.Length = v.`Item: Length (cm)`,
t.Width = v.`Item: Width (cm)`,
t.Dimension = v.`Item: Dimension (cm³)`,
t.modelNr = v.Model,
t.Category = "Toys & Games",
t.SalesRank = v.`Sales Rank: Current`,
t.Weight = v.`Item: Weight (g)`,
t.Brand = v.Brand
RETURN t

```

---

<div class="post-metadata">

**Author:** ![tideon](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/tideon/32/4351_2.png) [@tideon](https://community.neo4j.com/u/tideon)\
**Post date:** [October 28, 2019, 2:16pm UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354/5 "2019-10-28T14:16:10Z")

</div>

Hello Mark,

You are razor sharp!!!!!

It worked. I just learned about using back ticks, and thought I used it, but as you clearly realized, those were single quotes. This lesson I will always remember for the rest of my career every time I use them, as I suspect it will often be the case whilst pulling in json from sites.

Hats off to you Mark.

I'm new to Neo4j, just started learning it earlier this year.

Many, many thanks.

Greetings

---

<div class="post-metadata">

**Author:** ![mark.needham](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mark.needham/32/104_2.png) [@mark.needham](https://community.neo4j.com/u/mark.needham)\
**Post date:** [October 29, 2019, 1:10pm UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354/6 "2019-10-29T13:10:11Z")

</div>

No worries - the error message is not particularly helpful in that respect unfortunately.

Cool, hope you're enjoying the journey so far!

---

<div class="post-metadata">

**Author:** ![tideon](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/tideon/32/4351_2.png) [@tideon](https://community.neo4j.com/u/tideon)\
**Post date:** [October 29, 2019, 1:27pm UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354/7 "2019-10-29T13:27:22Z")

</div>

Hello Mark,

Yes, I am definitely enjoying the journey. I am coming from the world of Relational Databases, so it is mind blowing how more efficient cypher and graphs are. Just having to get use to the syntax.

I have another question. Here is the link to the post. Maybe you know how to solve this issue.  
In all the tutorials I have looked at to date from people importing data, know one has ever "clean up" data . It is always imported as is, which is almost never the case in real world.

> [@Data clean-up before import](https://community.neo4j.com/t/data-clean-up-before-import/11399):
>
> Dear Everyone, I have a situation where I have a field with a price in it, but it also has the euro sign in the field (See attachment)/ What I would like to do is import the data from that JSON key value pair, but remove the euro sign, remove the empty space between the euro sign and price and also convert remaining information to integer (toInteger function). I have been trying trim string function, replace string function on the field, but it doesn't work. I tried to replace with a blank sp…

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![mark.needham](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mark.needham/32/104_2.png) [@mark.needham](https://community.neo4j.com/u/mark.needham)\
**Post date:** [October 29, 2019, 1:37pm UTC](https://community.neo4j.com/t/import-and-merg-json-data-with-apoc/11354/8 "2019-10-29T13:37:38Z")

</div>

Just replied to that one, but I'm not sure that I did anything different to what you already did!
