# Manipulate elements of repeat container using Javascript

**URL:** <https://community.ofelia.com/t/manipulate-elements-of-repeat-container-using-javascript/9556>\
**Category:** Q&A\
**Created:** [3 April 2019 17:26 UTC](https://community.ofelia.com/t/manipulate-elements-of-repeat-container-using-javascript/9556 "2019-04-03T17:26:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cguerram\_1396650](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@cguerram\_1396650](https://community.ofelia.com/u/cguerram_1396650)\
**Post date:** [3 April 2019 17:26 UTC](https://community.ofelia.com/t/manipulate-elements-of-repeat-container-using-javascript/9556/1 "2019-04-03T17:26:05Z")

</div>

Hi,

I’m trying to manipulate two select widgets in a repeat container using the UI Designer in Bonita BPM 7.8.3. The behaviour that I want to implement is:

1. In the first select widget I choose a country from a list stored in a variable.

2. Based on the value of the country, I want to load in the second select widget the states of that country . I’m trying to use a Javascript Expression to implement it, but I can not access to contextual variables (e.g.: $collection, $item, $index) in the Javascript Expression (I can only access to $data).

Could anyone tell me how could I access to this variables or if it’s another way to implement it?

Thanks.

---

<div class="post-metadata">

**Author:** ![fabien.delannoy](https://avatars.discourse-cdn.com/v4/letter/f/76d3ee/32.png) [@fabien.delannoy](https://community.ofelia.com/u/fabien.delannoy)\
**Post date:** [6 June 2019 14:57 UTC](https://community.ofelia.com/t/manipulate-elements-of-repeat-container-using-javascript/9556/2 "2019-06-06T14:57:40Z")

</div>

Hi,

We’ve made a fragment in our container collection, then we can call some javascript without being annoyed with $item variables.

Fabien.

---

<div class="post-metadata">

**Author:** ![marcos.laurito](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@marcos.laurito](https://community.ofelia.com/u/marcos.laurito)\
**Post date:** [30 September 2020 15:40 UTC](https://community.ofelia.com/t/manipulate-elements-of-repeat-container-using-javascript/9556/3 "2020-09-30T15:40:30Z")

</div>

Hi, i'm having this same problem. Have you resolved it??

Thanks

---

<div class="post-metadata">

**Author:** ![marcos.laurito](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@marcos.laurito](https://community.ofelia.com/u/marcos.laurito)\
**Post date:** [30 September 2020 15:41 UTC](https://community.ofelia.com/t/manipulate-elements-of-repeat-container-using-javascript/9556/4 "2020-09-30T15:41:12Z")

</div>

Can you explain this solution a little bit further?

Thanks
