# Creating barcode id - uncheck box

**URL:** <https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620>\
**Category:** Ignition\
**Created:** [December 29, 2023, 8:18pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620 "2023-12-29T20:18:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![HelloWorld](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@HelloWorld](https://forum.inductiveautomation.com/u/HelloWorld)\
**Post date:** [December 29, 2023, 8:18pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620/1 "2023-12-29T20:18:09Z")

</div>

I have this page where a user can check boxes to produce a value for a barcode. How can I handle when a box is unchecked remove that part from the barcode value.

 ![Screenshot (9)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/8/c875e5e1b3a8e771b41a4657499f7f414d9815f8.png)

---

<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:** [December 29, 2023, 8:28pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620/2 "2023-12-29T20:28:38Z")

</div>

On the barcode create an Expression Structure binding referencing each of the checkboxes and calculate the output.

---

<div class="post-metadata">

**Author:** ![HelloWorld](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@HelloWorld](https://forum.inductiveautomation.com/u/HelloWorld)\
**Post date:** [December 29, 2023, 8:35pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620/3 "2023-12-29T20:35:50Z")

</div>

Doesn't expression structure return an object? I have never used expression structure.

---

<div class="post-metadata">

**Author:** ![HelloWorld](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@HelloWorld](https://forum.inductiveautomation.com/u/HelloWorld)\
**Post date:** [December 29, 2023, 8:56pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620/4 "2023-12-29T20:56:07Z")

</div>

Im thinking whenever a check box is selected add the correct value to barcode value , and just have a master reset button which clears the barcode value, but that still would be weird if one was unchecked and nothing happened

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 29, 2023, 9:05pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620/5 "2023-12-29T21:05:47Z")

</div>

Show examples of how the barcode string should be assembled with and without the various parts. And what the result should be if all checkboxes are off.

---

<div class="post-metadata">

**Author:** ![HelloWorld](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@HelloWorld](https://forum.inductiveautomation.com/u/HelloWorld)\
**Post date:** [December 29, 2023, 9:10pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620/6 "2023-12-29T21:10:41Z")

</div>

It will be assembled however the user wants. The order they selected them in concatenate the value to the barcode value. Say the user checks ProductID and SampleID - The ProductID param and SampleID param from view get concatenated to the barcode value. If nothing is checked the barcode value stays empty.

---

<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:** [December 29, 2023, 9:33pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620/7 "2023-12-29T21:33:35Z")

</div>

> [@HelloWorld](#):
>
> Doesn't expression structure return an object?

Yes it does and the individual elements can be read.

 ![Barcode checkboxes](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/e/7e56e3df0d6322f255f8ea2ca8477ce95fd60550.png)

> **Expression**
>
> ```python
> if({value}['chkProd'], {view.params.ProductID}, "")
> + "-" +
> if({value}['chkSamp'], {view.params.SampleID}, "")
> + "-" +
> if({value}['chkSub'], {view.params.SubSampleID}, "")
> 
> ```

The expression will re-evaluate any time any of the structure bindings change. That's what you want and you have no tricky scripting to sort out.

---

<div class="post-metadata">

**Author:** ![HelloWorld](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@HelloWorld](https://forum.inductiveautomation.com/u/HelloWorld)\
**Post date:** [December 29, 2023, 10:06pm UTC](https://forum.inductiveautomation.com/t/creating-barcode-id-uncheck-box/83620/8 "2023-12-29T22:06:16Z")

</div>

Thanks Ill try it out
