# pages.setActiveControlSet(controlSetId) Help Please

**URL:** https://forum.electra.one/t/pages-setactivecontrolset-controlsetid-help-please/3239
**Category:** Developers
**Created:** [September 14, 2024, 6:55pm UTC](https://forum.electra.one/t/pages-setactivecontrolset-controlsetid-help-please/3239 "2024-09-14T18:55:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rkram53](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rkram53](https://forum.electra.one/u/rkram53)
#### Post date: [September 14, 2024, 6:55pm UTC](https://forum.electra.one/t/pages-setactivecontrolset-controlsetid-help-please/3239/1 "2024-09-14T18:55:50Z")

</div>

Can someone please clarify how this works. I’m on Page 1 and if you press a button in Set 2 I want to change the set to move to 1. I’ve tried a number of things but keep getting an "attempt to call a nil value (method ‘setActiveControlSet’) error.

I’ve tried calling this directly: pages.setActiveControlSet(1)

I’ve tried setting a variable in case that is what you need to do:  
page = pages.get(1)  
page:setActiveControlSet(1)

Actually, if I press the control for a bit instead of quick press, the active set moves to 1 with this: page:setActiveControlSet(1) but then jumps right back to set 2 while I’m pressing. I’m calling this from a Momentary control that is part of set 2 as the last thing in the function. Does it see that I’m calling from set 2 and set it back? Then how can you set the active control. Do I see to set some on.function can call it there?

Would be nice if the manual had an explicit example but can someone please clarify this for me please. Thanks.
