Jump to content
WAPT Forum
Sign in to follow this  
Guest KirkL

Parsing JSON from response body and putting it into a variable

Recommended Posts

Guest KirkL

I am new to WAPT and having trouble taking JSON from the response body, putting it into a variable, then using it on a subsequent request body.


I have the JSON module installed and am using WAPT 7.5.


My response body on one request is JSON that looks like the following:



{ "name":"john" },

{ "Id":10 }



I simplified it considerably, but debugged into a Javascript file where I copied the output to make sure I know the syntax.


In the end I need <object>[1].Id. So I created a "Response processing" variable named "userId" and added a "JSON Text" function for it to get "[1].Id", but I know I am missing something. It's like I need "$Var(Respose_Body)[1].Id" or something.


Any ideas?


In the next request I used $Var(userId) in the request body, but it just shows up as hard-coded "[1].Id" instead of my value.

Share this post

Link to post
Share on other sites
Guest KirkL

Could you give me your profile or send it to support?


I figured it out and was unable to delete my thread yesterday since it hadn't gone through the moderator yet. I was looking through the help docs and didn't notice that there was a separate help doc for the JSON module. Once I found that I realized that $JPath was what I needed.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this