How to write if else condition for catch section in trycatch

im for looping get text
so in get text if error comes
then on get text i have surrounded with trycatch
in try section it will try to get text
so if it fails, i want to write if else condition like if exception is true then it has to execute one workflow or else it will execute another workflow so may i know how to write if else condition?

Hi @sathish_Kumar6,

You can sorround get text in try catch block and after get text activity, use only if condition and steps or workflow you want to execute in if condition.
In catch block you can write rest code you wanted to write for else condition.


i already had that idea but I wanted to try with different approach so thats why i have asked

Hello @sathish_Kumar6 ,

  1. You can keep continue on error true for get text and use a If condition to check If extracted value from get text is null or empty.
    If its null you can execute 1 set of action and If not null then another set of actions.
  2. As said above, you can use try catch and in catch block you can execute certain activities for exception case and in try block execute activities for success case.


okay thanks for the ideas,
im for looping get text activity so get text value is not getting null,
like what happens is its taking previous gettext value so in write cell its appending the same previous get text value in write cell so thats what the problem…
But i didnt try continue on error…

@sathish_Kumar6 ,

If you are using for loop then either you can restrict the value of GetText variable inside the sequence of GetText and write cell, so whenever it goes out of sequence for next item in loop your GetText variable will not be having any value. Or you can Assign a null value for GetText variable with string.Empty after write cell so it won’t retain the previous value.


1 Like

sorry rohith never done this before and i dont know how to do it sorry

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.