katalon recorder, how to use 'if' command

can someone give example how to type target for ‘if’ command, if possible provide some example. I need something like if storetext fail will go to click, if storetext success will go to appendToCSV. and appendToCSV i encounter error error the amount of data miss match the amount of column in data file. please help, thanks.

Maybe the bit of code in this question might help:

@dedavag177
what do you mean with “if storetext fail” ? Is it “there is no content within the variable” ?

Martin :de:

I’m guessing it means in this case if it looks to store that text, and what it is searching for cannot be found, that it then does X, but if it can find the text, then it does Y.

The way it could be done is to store the value in a variable, then do an if / else, where it checks if the variable contents the expected value, else (e.g. if it’s null) then do the other steps. (e.g. if | (“${Var}”).includes(“desired-text”) … else … endif). You could also use elseif (vs. else) if it must be one or the other to perform the actions.