# Setting instance properties in a list?

**URL:** <https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678>\
**Category:** Ignition\
**Created:** [July 18, 2025, 3:58pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678 "2025-07-18T15:58:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [July 18, 2025, 3:58pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/1 "2025-07-18T15:58:10Z")

</div>

I have a list of checkboxes. I want a button that will go through the list and disable or enable them. The disable code is:

```python
def runAction(self, event):
	logger = system.util.getLogger("PERS disable")
			
	logger.info("START")
		
	Parent = self.parent
	EmbeddedView = Parent.getChild("EmbeddedView_Ballot")
	Instances = EmbeddedView.props.params.instances
	
	#Create a dataset of one row	
	Names = []
		 
	# step through the rows
	for instance in Instances:
		instance.enable = False
		logger.info("Instance disable " + str(instance.text))	
		
		
	logger.info("disable complete")

```

The logger shows it is executing:

 ![ig_setlistprops_2025-07-18 at 10.51.23 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/772d545f8c4c11c8218345f4382c043df18436b4.jpeg)

The enable property is not being set false:

 ![ig_setlistprops_2025-07-18 at 10.52.15 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5e0c29860b62eaea4d3f048fdbc280441ac6206.jpeg)

I think the code is only setting the local variable in the script. It is not actually setting the property on the checkbox instance.

How do I do this?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 18, 2025, 4:07pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/2 "2025-07-18T16:07:14Z")

</div>

I think I would handle this with a messageHandler on the embedded view, then the button script would just be:

```python
system.perspective.sendMessage('clearAll',{})

```

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [July 18, 2025, 4:09pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/3 "2025-07-18T16:09:02Z")

</div>

That looks to be a flex repeater? On whatever source template/view you are using, you'll need to bind the view parameter`enabled` to the actual `enabled` property of the checkboxes.

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [July 18, 2025, 4:21pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/4 "2025-07-18T16:21:46Z")

</div>

I can't do a hard binding, the list is created dynamically

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [July 18, 2025, 4:23pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/5 "2025-07-18T16:23:19Z")

</div>

I don't think that does what I want. I do not want to clear the selections. I want to disable the checkboxes so whatever selections have been made cannot be changed

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 18, 2025, 4:31pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/6 "2025-07-18T16:31:04Z")

</div>

Okay, small mis-understanding on my part (apparently I can't read). No big.

Same approach.

messageHandler on the embedded view, that will change the enabled bit. Something like:

```python
system.perspective.sendMessage('toggleEnable',{'enable':1})

```

Just change the payload depending on the need.

Then the messageHandler would be:

```python
def onMessageReceived(self, payload):
	#obviously this needs to actually point at the checkBox
	self.props.enable = payload['enable']

```

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [July 18, 2025, 4:47pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/7 "2025-07-18T16:47:13Z")

</div>

The dynamic list is driving the repeater, the repeater is repeating a view that is defined elsewhere in the project. Somewhere there will be a view that is just a checkbox, and maybe a label. Do the changes I mentioned on that source view, not the view with the flex repeater.

Start by inspecting the `CVoz_Ballot_Approval` view and see what view its template repeater is using.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 18, 2025, 10:46pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/8 "2025-07-18T22:46:30Z")

</div>

> [@pdixon](#):
>
> ```python
> # step through the rows
> for instance in Instances:
> instance.enable = False
> 
> ```

You have a typo: you're setting `enable` instead of `enabled`

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [July 20, 2025, 7:02pm UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/9 "2025-07-20T19:02:02Z")

</div>

The message handler approach is perfect! Thanks Irose!

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 22, 2025, 2:18am UTC](https://forum.inductiveautomation.com/t/setting-instance-properties-in-a-list/108678/10 "2025-07-22T02:18:30Z")

</div>

> [@pdixon](#):
>
> ```python
> Parent = self.parent
> EmbeddedView = Parent.getChild("EmbeddedView_Ballot")
> Instances = EmbeddedView.props.params.instances
> 	
> #Create a dataset of one row	
> Names = []
> 		 
> # step through the rows
> for instance in Instances:
> instance.enable = False
> logger.info("Instance disable " + str(instance.text))	
> 
> ```

FWIW also, you should never update your gui props from a script from within a loop like this as it will be slow and users will see the components changing 1-by-1. You should get a copy of the prop into a variable, modify the variable, and only then write it back to the prop at the end. e.g. in this case, write the whole `instances` list back to the prop.
