I have a sample JSON in MockAPI with a data object like this:
“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]);
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.