How to stop the bot if a text doesn't exist

Hi,

I am using get text activity and want to check for a particular text is exist or not. If exists then the bot should go for the next activities, if not then it should stop the bot.
How can we do it?

Regards

Hi @raju_alakuntla

You can check the text file using if activity from the below expression
File.Exists(Your filepath)
In the then block you can continue your workflow , In the else block you simply use throw activity that will throw an customized error Ex: BusinessRuleException(“Input text file is not found”)

hope its solves your issue and please update us if got your desired solution

Regards,
Robinnavinraj S

Hi @raju_alakuntla

Try this-

  1. Use the Get Text activity to retrieve the text you want to check. Configure the activity to extract the desired text from the target element.
  2. Add an If activity after the Get Text activity. Set the condition of the If activity to check if the retrieved text matches the specific text you are looking for. For example, you can use the condition textVariable.Contains("desiredText") to check if the desired text exists within the retrieved text.
  3. Inside the “Then” block of the If activity, place the activities that should be executed when the desired text is found. This can include the next set of actions or activities you want the bot to perform.
  4. If you want the bot to stop if the desired text is not found, you can simply place the activities that should be executed in this scenario in the “Else” block of the If activity.