Extracting a value from a json response body and raising it by 1

Hi everybody,

I retrieve data with a GET and then use the values ​​in a POST. There is a field whose response I want to increment by 1 by default. So if the response from the GET is 5 I want to post 6. To get the content from the GET and write it to the variables to use as POST I wrote the following in Tests:

valueincomeRelationshipNumber = bodydata._embedded[0].incomeRelationshipNumber
console.log(“value of incomeRelationshipNumber:” + valueincomeRelationshipNumber)
pm.environment.set(“Income Ratio No.”, valueincomeRelationshipNumber);

What should be added to this so that the result is always +1?

Hey there,

That question has already been asked a few times, have you tried any of these answers?

1 Like