# Access list variable and access each index to pass in in a session

**URL:** <https://community.gatling.io/t/access-list-variable-and-access-each-index-to-pass-in-in-a-session/8475>\
**Category:** Gatling (Open-Source)\
**Created:** [November 22, 2023, 11:02am UTC](https://community.gatling.io/t/access-list-variable-and-access-each-index-to-pass-in-in-a-session/8475 "2023-11-22T11:02:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lathem](https://avatars.discourse-cdn.com/v4/letter/l/bb73d2/32.png) [@Lathem](https://community.gatling.io/u/Lathem)\
**Post date:** [November 22, 2023, 11:02am UTC](https://community.gatling.io/t/access-list-variable-and-access-each-index-to-pass-in-in-a-session/8475/1 "2023-11-22T11:02:23Z")

</div>

Hi Team ,

Its me again,

I have obtained session variable from a http post response,  
It is having array elements, i want to pass each element in an array to my next http request kind of correlation , But i have obtainted values like this [a,b,c,d]  
i want to pass those individuatl elements, I am using Gatling Java  
Someone please help me

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [November 22, 2023, 12:31pm UTC](https://community.gatling.io/t/access-list-variable-and-access-each-index-to-pass-in-in-a-session/8475/2 "2023-11-22T12:31:48Z")

</div>

Hi @Lathem,

Did you consider [`foreach`](https://gatling.io/docs/gatling/reference/current/core/scenario/#foreach)?

If this is not enough, please make a reproducer and explain what you observe and what you expected.

Cheers!

---

<div class="post-metadata">

**Author:** ![Lathem](https://avatars.discourse-cdn.com/v4/letter/l/bb73d2/32.png) [@Lathem](https://community.gatling.io/u/Lathem)\
**Post date:** [November 22, 2023, 1:53pm UTC](https://community.gatling.io/t/access-list-variable-and-access-each-index-to-pass-in-in-a-session/8475/3 "2023-11-22T13:53:38Z")

</div>

I have just called their index like #{id(0)}

This worked for me  
Thanks for responding 🙂

Meanwhile by any chance we have builtin date functions to get next date ,

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [December 22, 2023, 1:54pm UTC](https://community.gatling.io/t/access-list-variable-and-access-each-index-to-pass-in-in-a-session/8475/4 "2023-12-22T13:54:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
