Storing multiple server response from a list of options

Hi,

I am trying to create a script in Gatling for a scenario where I have to store form variables from
a post request and the value occurs more than once so my approach is
to store the values in an array and use the array values in the succeeding pages.

Could someone please share as to how can I proceed with this approach?

Regards,
Reetu

Somewhere in the doc, it talks about various ways to manipulate the response. Basically, you have the json response and you can parse it to find the value or values and store them in your session. Here is a code snippet, where I am browsing the user table and collecting all the "id"s for later use.

.exec(http("Request_browse_all_users")
 .get("/users")
.headers(headers_basic)
.headers(authHeader("${authToken}"))
.check(status.is(200), jsonPath("$..id").findAll.saveAs("user_ids")))

Hope that helps.

Thanks