-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
ParseJson Type mismatch error #329
Comments
In the simplest case:
Should produce the output:
You can also look at some of the samples in #260 if you need to test what kind of value a key has. JSON like this
can start to get more challenging if you're going in blind. |
Thanks zgrose, Here's a condensed sample of the json string returned in Response.Content: JSonText = "[{"row":1,"a:"0007","b:"Blue","c:"2008"},{"row":2,"a:null,"b:"","c:"1709"}] The real response could have 100 rows with 17 keys, so the ultimate goal is to extract the data as records to write to a db. The Response.Data returned from WebClient.GetJson is, I'm guessing, a Collection. So how can I loop through the rows and get both the keys and values for each row? Ultimately I could explicitly use the key name and get the values as stated above but it seems like the long way around the problem when you could step through the keys with an index. I'm wondering if I'm using the correct tool for the problem. In any case I still prefer to learn the proper use of the functions. |
Here is any Excel-y way to dump your rows into a worksheet. There are lots of ways to skin this same cat but hopefully gets you closer.
Should output like: |
Better version that reads the object properties and makes into a table with headers:
|
Thanks zgrose. That method did the job. |
Hi:
I get a Type mismatch with the following code:
I believe this is due to some values being "" (zero length string)?
So I tried a different method using Response.Data which appears to be in the form of a Dictionary but I can't seem to retrieve the key names. I can loop through Response.Data and get the values if I explicitly state each key name (example: Response.Data(i)("[key name]")), but I can't seem to loop through the keys and output the key name and value.
What am I missing?
The text was updated successfully, but these errors were encountered: