Forum Discussion
Hey rcummings
I'm on my phone so i cant double check by reproducing your issue, and it's been awhile since I bothered using a json data source, but the jsonpath to the contracts array is simply $.contracts - i.e. without any array indicator (e.g. [])
have you tried using just $.contracts ??
nice one,
Rich
- rcummings4 years agoNew Contributor
Thank you...
When I use "contracts", I get the first entry only when there is just a single element in the array, "[]" if the array is empty and for records with multiple elements in the array I get nothing.
If I use contracts[*].url, I get nothing for any records.
If I use contracts[0].url, I get the first element for records that have elements. And I can use other integers to access other elements. But I can't get all of them.
- richie4 years agoCommunity HeroHi rcummings,
Im bit busy today (moving house) so cant reproduce today, however, ive just remembered when i was using the json datasource a couple of years ago i always had problems. It seemed a little flakey and struggled to get it to work and dont know if the functionality has changed.
I could be wrong, but i think i got around the problems by using the xml datasource but switched the type to jsonpath within the xml datasource. This worked for me.
Can you try the xml datsource but changing the type?
I will get to looking at it tomorrow, but wanted to respond with this possible workaround whilst youre waiting.
Cheers,
Rich
- rcummings4 years agoNew Contributor
I tried various combinations and I am not seeing it work. I started to use a groovy script as the data source and it had no problem with the structure.
- rcummings4 years agoNew Contributor
That did not work, too. Thanks.
Related Content
- 8 years ago
Recent Discussions
- 22 days ago