Question
Warren Baldock · May 26, 2020

JSONStreamtoObject - accessing item in JSON response

Hello All,

I am compiling a REST Operation to call our hospital Administration system, following tutorials around the REST API's etc. First time we have integrated like this so not much knowledge around our hospital - hoping someone on here can help.

I have been using the JSONStreamToObject Method which is working as i expected, apart from trying to get a specific item in the example JSON Response as follows:

{"test":"abc","name":[{"use":"usual","family":"Matest","given":["Mia"]}]}

I'm able to get family using set pResponse.familyname = tProxy.name.GetAt(1).family  , plus other properties within the response (ive left those out to make it simpler for you to understand my question).

What code do i need to use to return the given name "Mia"? I've tried various iterations using the GetAt but it is not returning and i usually get an error. The only time i can run the operation without an error is when i'm using set pResponse.familyname = tProxy.name.GetAt(1).given

however this just doesn't return anything. 

Any help would be greatly appreciated, i'm sure its probably simple but we just don't have that knowledge at the minute to crack it. 

Thanks very much

Warren

 

 

 

00
1 0 2 165
Log in or sign up to continue

Replies

set pResponse.familyname = tProxy.name.GetAt(1).given.GetAt(1)

Thanks Eduard. Think thats about the only thing i didnt think of trying. It also didn't help i was referencing pResponse.familyname for both Given and family names.