# Set checkbox True if a data is founded on database

**URL:** <https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777>\
**Category:** Ignition\
**Created:** [July 12, 2022, 8:33am UTC](https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777 "2022-07-12T08:33:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [July 12, 2022, 8:33am UTC](https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777/1 "2022-07-12T08:33:32Z")

</div>

Hello,

I added a checbox on my View as shown in the images below,

I would like to set True on checkbox if a value is found on a column of my database.

For example, if the CountFileUploaded variable is \>0 then checkbox = True  
Otherwise, checkbox = false

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/b/5b18754ebf7459830a27aa75a0d671b282498141.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aaa02f0de5d15ceaab8397cf1c36e61a1cae2538.png)

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [July 12, 2022, 8:52am UTC](https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777/2 "2022-07-12T08:52:39Z")

</div>

Solved.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 12, 2022, 2:26pm UTC](https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777/3 "2022-07-12T14:26:02Z")

</div>

Instead of just claiming it is solved, could you explain what you did? One of the primary purposes of the forums is to share knowledge and examples, and someone in the future might need to know how you did this.

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [July 12, 2022, 2:52pm UTC](https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777/4 "2022-07-12T14:52:15Z")

</div>

here is the script implemented to get the solution

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c6574a1644ade4fa14d713befd8cfb3d4a82f91c.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 12, 2022, 2:55pm UTC](https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777/5 "2022-07-12T14:55:05Z")

</div>

I don’t think you posted the screenshot you expected. The displayed script would ALWAYS evaluate to `True`, and so is not representative of any column actually containing your value.

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [July 12, 2022, 3:03pm UTC](https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777/6 "2022-07-12T15:03:08Z")

</div>

I do a SQl request to search on my database if there is files upload on the table.  
if I find a data on the table documents where eevents.eventID =documents.eventID  
I set value True

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/4/047650f59404e90ca4cd0c7985a63e2bb94fae67.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/8/a805b5e15df49328da01e0cd6d000a6ecc431416.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/a/fab2012a876ec7b379b4c518d41325d8b9356a71.png)

---

<div class="post-metadata">

**Author:** ![sebastien\_ng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sebastien_ng/32/55297_2.png) [@sebastien\_ng](https://forum.inductiveautomation.com/u/sebastien_ng)\
**Post date:** [July 12, 2022, 3:05pm UTC](https://forum.inductiveautomation.com/t/set-checkbox-true-if-a-data-is-founded-on-database/61777/7 "2022-07-12T15:05:19Z")

</div>

it work for me.  
The first script that i sent , I only useded it to get days of next month. i will use that to my schedule
