Hi all,
I'm working with Excel to access the xml data, in my test case, access a specific ticket.
I'm using the handy VBA function created by Tim Hall. This seems to be widely used.
I successfully extract/parse the ticket info, however, I'm having issues with ways of accessing the data within the VBA object I set.
See small snippet of code I'm struggling with.
'declarations
Dim jsonObject As Object, item As Variant
Set jsonObject = ParseJson(sResponse) 'successfully creates object with xml data
For Each item In jsonObject("fields")
'this debug print doesn't work
debug.print item("customfield_11721")
Next
'the debug print works fine.
'Debug.Print jsonObject("fields")("customfield_11721")
Looking at the 'Locals' window shows no additional array values of 'item' so I see why it's not working in my case. There are no values other the value of 'customefield...' etc.
I can query the object using the last debug print statement so the data is there and correctly stored.
I've seen examples of code that shows this method works within the for each statement, using the same Tim Hall code. I was wondering if this is the case and I'm missing the proper syntax?
Thanks