Skip to content
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

Nested JSON File Issue #24

Open
emzipoo4u opened this issue Oct 5, 2022 · 1 comment
Open

Nested JSON File Issue #24

emzipoo4u opened this issue Oct 5, 2022 · 1 comment

Comments

@emzipoo4u
Copy link

The httpResponse text looks like...

  {"returnObj":{"LaborHed": 
    [{"Company":"MYCOMPANY","EmployeeNum":"A","LaborHedSeq":106,"PayrollDate":"2022-10- 
    06T00:00:00","Shift":11,"ClockInDate":"2022-10-05T00:00:00",

According to other posts on this topic it looks as though the issue I am getting is because the response is nested in "returnObj": though i can't see how to resolve. Please can I have an example of parsing the above response.

@ThorvaldAagaard
Copy link

ThorvaldAagaard commented Oct 6, 2022

Could you give the error code you get?

The response looks incomplete, so I am not able to test it

I think it is the array, that is causing trouble, but i have tried

{"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,"CD":false,"Question":[{"name":"netbridge.dk.","type":15}],"Answer":[{"name":"netbridge.dk.","type":15,"TTL":3600,"data":"10 alt3.aspmx.l.google.com."},{"name":"netbridge.dk.","type":15,"TTL":3600,"data":"1 aspmx.l.google.com."},{"name":"netbridge.dk.","type":15,"TTL":3600,"data":"5 alt2.aspmx.l.google.com."},{"name":"netbridge.dk.","type":15,"TTL":3600,"data":"10 alt4.aspmx.l.google.com."},{"name":"netbridge.dk.","type":15,"TTL":3600,"data":"5 alt1.aspmx.l.google.com."}],"Comment":"Response from 185.25.141.15."}

then calling

oJSON.loadJSON()
oJSON.JSONoutput())

and getting this result result

{ "Status": 0, "TC": false, "RD": true, "RA": true, "AD": true, "CD": false, "Question": [ { "name": "netbridge.dk.", "type": 15 } ], "Answer": [ { "name": "netbridge.dk.", "type": 15, "TTL": 3600, "data": "10 alt3.aspmx.l.google.com." }, { "name": "netbridge.dk.", "type": 15, "TTL": 3600, "data": "1 aspmx.l.google.com." }, { "name": "netbridge.dk.", "type": 15, "TTL": 3600, "data": "5 alt2.aspmx.l.google.com." }, { "name": "netbridge.dk.", "type": 15, "TTL": 3600, "data": "10 alt4.aspmx.l.google.com." }, { "name": "netbridge.dk.", "type": 15, "TTL": 3600, "data": "5 alt1.aspmx.l.google.com." } ], "Comment": "Response from 185.25.141.15." }

But unable to get the array using any code

So perhaps you can try to serialize and the deserialize?

I found btw that

For Each i In oJSON.data("Answer").Items
    response.write i.item("data") 
Next 

can access the data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants