New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help tackling json tree parent and child lookup #3006
Comments
You'll keep running into uneven errors this way. What you can do is put two website agents in series and use the
Additionally, I would suggest using a trigger agent to filter out the |
Thanks for the guide! Let me digest it and try it out. I've never used a
trigger agent before, why is it better to use a trigger agent rather than
filtering it out with the jsonpath? Do you mean using a trigger agent to
replace the second website agent in your suggested solution?
…On Sat, 31 Jul 2021, 02:54 Unending, ***@***.***> wrote:
You'll keep running into uneven errors this way. What you can do is put
two website agents in series and use the "repeat": "true" option on the
second one.
- First one "path": "..facilityBookingDailyTimeSlotDtoList.[*]"
creates an event per facility.
- And the second one creates an event per timeslot
"court": {
"path": "nameEn",
"repeat": "true"
},
"startDateTime": {
"path": "timeslotInfoList[*].startDateTime"
},
"isFree": {
"path": "timeslotInfoList[*].isFree"
}
Additionally, I would suggest using a trigger agent to filter out the "isFree":
false rather than doing it directly in jsonpath.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3006 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBISTQ7VXITLBTS7MF65JLT2LYNZANCNFSM5BIGS6TA>
.
|
I mean a third agent. As for why, I've often ran into weird or maintainability issues when trying to do to many things at once in a single agent. But whatever works for you. |
@Unending Could you please post the full code for the second Website Agent? I was playing around with this yesterday (I have a similar problem right now) but never got it to work the way it was supposed to. |
@virtadpt not much more to it:
|
@Unending 's solution worked for me and a third trigger agent is definitely needed. because if we try to filter "isFree" by true/false, the number of items of "isFree" must be less than the number of "startDateTime" because "startDateTime" will list all slots no matter free or not. thank you very much for your help! |
That's what I did wrong - thank you! |
Hi all, i have a scenario where i can poll the API to get the booking status of some tennis courts. and i've been trying to look for some free slots and notify myself.
i want to look for "isFree": true, corresponding time; and also get the corresponding parent element "nameEn": "3/F Tennis Court - Main Court A".
i have been playing around with json path syntax, and no matter what i do, even filter by child to get parent object, i cannot achieve my goal because of UNEVEN objects. the only thing that i can think of now is maybe i have to flatten the JSON tree? is there anyway to do that by any agent?
filter by child:
JSON data sample:
The text was updated successfully, but these errors were encountered: