XPATH with variables

Why not have a look at this: Parameterize a Test Object
https://docs.katalon.com/display/KD/Parameterized+a+Test+Object

You will find an example of a Groovy-String as XPath with a ‘index’ variable.

"//*[@id="main"]/div/table/tbody/tr[2]/td[${index}]/input"

And you can give value to the index variable with 2nd Map argument to findTestObject method call.

WebUI.check(findTestObject('chk_Title', [('index') : it]))

See https://api-docs.katalon.com/studio/v4.7.0/api/com/kms/katalon/core/testobject/ObjectRepository.html#findTestObject(java.lang.String,%20Map<Object,%20Object>) for detail