# Check a box based on value in Excel \*help!\*

**URL:** <https://forum.katalon.com/t/check-a-box-based-on-value-in-excel-help/62277>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [February 7, 2022, 2:30am UTC](https://forum.katalon.com/t/check-a-box-based-on-value-in-excel-help/62277 "2022-02-07T02:30:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmondo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vmondo/32/16104_2.png) [@vmondo](https://forum.katalon.com/u/vmondo)\
**Post date:** [February 7, 2022, 2:30am UTC](https://forum.katalon.com/t/check-a-box-based-on-value-in-excel-help/62277/1 "2022-02-07T02:30:18Z")

</div>

Hi, I’m trying without knowing too much about choosing check status from excel.  
I have my spreadsheet with my column in true or false and my code is as follows:

if (true) {  
WebUI.check(findTestObject(‘cargaMasiva/Page\_Registrar Horas/Prueba ddl CM/Page\_Registrar Horas/Page\_Registrar Horas/Page\_Registrar Horas/Page\_Registrar Horas/Check\_F’))  
} else {  
WebUI.uncheck(findTestObject(null))  
}

What should I correct?

in the tests it does not give me an error but it does not uncheck the box either

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [February 7, 2022, 4:39pm UTC](https://forum.katalon.com/t/check-a-box-based-on-value-in-excel-help/62277/2 "2022-02-07T16:39:37Z")

</div>

An **if** statement usually has a boolean condition within the parenthesis, like:

`if (hasChoice == true) { blah blah blah`

or even

`if (hasChoice) { blah blah blah`

But if you really have your “condition” statement as, **if (true) {**, then you really don’t need an if statement as there will **never** be a time for a false to occur.

Another concern is, `WebUI.uncheck(findTestObject( **null** ))`. this will never work. You need a name (or even a pathway) for your test object. **Fix this.**

Also, do you really have the **same folder name 4 times** or is this a copy and paste error.

```auto
findTestObject('cargaMasiva/Page_Registrar Horas/Prueba ddl CM/Page_Registrar Horas/Page_Registrar Horas/Page_Registrar Horas/Page_Registrar Horas/Check_F')

```

Otherwise, we need more information on your “choosing check status from excel”, like:

```auto
if (findTestData(...) == "true") { // notice I am testing against String true and not Boolean true
    WebUI.check(findTestObject('cargaMasiva/.../Check_F'))
} else {
    WebUI.uncheck(findTestObject('yourTestObjectToUncheck'))
}

```

---

<div class="post-metadata">

**Author:** ![vmondo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vmondo/32/16104_2.png) [@vmondo](https://forum.katalon.com/u/vmondo)\
**Post date:** [February 14, 2022, 3:16am UTC](https://forum.katalon.com/t/check-a-box-based-on-value-in-excel-help/62277/3 "2022-02-14T03:16:35Z")

</div>

I ve checked some errors like IF and NULL and it worked!

thank you so much!!!
