# Checkboxes on Perspective Forms - No initial value?

**URL:** <https://forum.inductiveautomation.com/t/checkboxes-on-perspective-forms-no-initial-value/114342>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 5, 2026, 4:09pm UTC](https://forum.inductiveautomation.com/t/checkboxes-on-perspective-forms-no-initial-value/114342 "2026-03-05T16:09:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![surety975](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@surety975](https://forum.inductiveautomation.com/u/surety975)\
**Post date:** [March 5, 2026, 4:09pm UTC](https://forum.inductiveautomation.com/t/checkboxes-on-perspective-forms-no-initial-value/114342/1 "2026-03-05T16:09:48Z")

</div>

I’m trying to use the Form component to add a record to a database table I’ve created.

I think I’ve got it working, with the exception of two boolean fields.

I initially tried using toggle switches. When the form loads, the switches are in the Off position. If I change them to On, the data is recorded as True. If I toggle them twice (Off → On → Off), the data is recorded as False. But if I never toggle them, I get an error message:

> Caused by: java.lang.Throwable: Incorrect integer value: 'undefined' for column 'active' at row 1

I’m running into a similar issue using checkboxes. Strangely, the checkboxes don’t seem to register the first time I click them, but after that, it’s essentially the same issue.

I’ve tried testing for “togglevalue is None,” but this doesn’t seem to help.

Digging through the properties of the form components, I don’t see a way to explicitly initialize the value of the toggle switches or checkboxes.

Any thoughts would be appreciated. I’m new to Ignition / Python / Jython, so I AI’d the scripting, but I’ve been programming databases longer than I care to admit.

Here’s a portion of the script I’m using, simplified for brevity.

```python
	...
	active = data.get("Active", False)
	obsolete = data.get("Obsolete", False)
	...
	if active is None: active = False
	if obsolete is None: obsolete = False
	...
	query = """
	INSERT INTO tbl (
		id, description, 
		active, obsolete
	) VALUES (
		?, ?, 
		?, ?
	)
	"""
	
	args = [
		id,
		description,
		active,
		obsolete
	]
	
	rows = system.db.runPrepUpdate(query, args, "ign") 

```

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 5, 2026, 11:18pm UTC](https://forum.inductiveautomation.com/t/checkboxes-on-perspective-forms-no-initial-value/114342/2 "2026-03-05T23:18:08Z")

</div>

I may be missing something in your post but try this:

- Give the checkbox widget an `id`. In my quick check it was  
`columns.items.0.rows.items.4.widgets.0.id : chkbox0`
- Then in the root of the PROPS add the following property and setting.  
`data.widget.chkbox0 : false`

The form data is readable and writeable in the `data.widget` section.

It appears that if you don't specify id names that the form data shows up as 0:, 1:, etc., but you don't really know which is which.

---

<div class="post-metadata">

**Author:** ![surety975](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@surety975](https://forum.inductiveautomation.com/u/surety975)\
**Post date:** [March 6, 2026, 7:09pm UTC](https://forum.inductiveautomation.com/t/checkboxes-on-perspective-forms-no-initial-value/114342/3 "2026-03-06T19:09:51Z")

</div>

That worked, thank you!
