
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 :
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 :
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
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think your JSON Query for each column is incorrect, try it as "$.@id"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think your JSON Query for each column is incorrect, try it as "$.@id"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you so much, It worked !!!!
Best regards !
