Displaying json response from REST API

I have a sample JSON in MockAPI with a data object like this:
“id”: “5”,
“first_name”: “Isom”,
“last_name”: “Rau”,
“email”: “Myah_Windler@yahoo.com”,
“home”: “”,
“work”: “Orn Manors”

During the run time, I need to get the address of the user based on the user selection of address type (home or work).

How do I get the data ?

The following did not work. Please help.

print( context.entities.address_type +" Address is : " + context.userservice.response.body[context.entities.address_type]);

Hi @pradeepa.loganathan,

We infer from your post that you would like to pass the addressType value captured by the address_type entity node to the service node which has the mockAPI.

If the API accepts the addressType value as a parameter. Then you can pass context.entities.address_type to that parameter.

Please find more detailed explanation on using service node


Let us know if your requirement is other than the above.

Yoga Ramya