Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Ema_fr
Contributor

Extracting data from a Json array (collection)

Hello everyone,

 

I haven't yet found a way to extract the data given by my tREST component.

Here's the scenario :

 

0683p000009M257.png

My data is a JSON array like :

[
{"@id":201215,"link":{"@rel":"self","@href":"\/api\/groupe\/201215"},"libelle":"test \u00e0 moi 46546846","abrege":"test_dependances_2","entites":"Personne","description":null},
{"@id":201219,"link":{"@rel":"self","@href":"\/api\/groupe\/201219"},"libelle":"test \u00e0 moi 46546846","abrege":"test_dependances_2","entites":"Personne","description":null}
]

 The tExtractJSONfields is filled that way :

 

0683p000009M2Zu.png

I can't seem to obtain the response I wish for.

 

I checked with a tlogRow immediately after the tREST component and the answer is correct so far.

 

Do you have any idea what's wrong with my reasoning ?

 

Thanks for your suggestions and help !

 

Best regards,

 

Ema

Labels (4)
1 Solution

Accepted Solutions
David_Beaty
Specialist

Hi,

 

I think your JSON Query for each column is incorrect, try it as "$.@id"

 

View solution in original post

3 Replies
Ema_fr
Contributor
Author

Hi,

Further info : error log shows :

com.jayway.jsonpath.InvalidPathException: Invalid path $id

=> if I replace the "@" before the tExtractJSONfields, it does the trick;

But, is it really impossible to use the character "@" in field name ?

Thank you all for your insight,

Ema

David_Beaty
Specialist

Hi,

 

I think your JSON Query for each column is incorrect, try it as "$.@id"

 

Ema_fr
Contributor
Author

Hi,

Thank you so much, It worked !!!!

Best regards !