How to provide condition in Text Exist

Hi Team,

Is there a way we can provide condition for Text Exist activity

Eg
“GL Account 2005 is relevant to Taxcode”

Or

“GL Account 1008 is relevant to Taxcode”

So it needs to check if any one of these are present

Thanks in advance!

Hello @anmita try this:

  1. Open your UiPath project and drag the “Text Exists” activity onto the workflow.
  2. In the “Text Exists” activity properties, set the target element where you want to check for the text. This can be a UI element, a text variable, or an image.
  3. Now, in the “Text” property of the activity, you can provide the conditions you want to check for. To check for multiple text patterns, you can use the “Or” operator along with the text patterns you want to search for.

@anmita

Use text exist activity to indicate on screen and store it in a boolean variable

Simply use if condition like
“YourInputString”=bool

True:then perform actions

Hi @anmita
Method 1

// If extracted text is stored in a variable called "extractedText"

If 
extractedText.Contains("GL Account 2005 is relevant to Taxcode") Or extractedText.Contains("GL Account 1008 is relevant to Taxcode") Then
    // Perform the necessary actions here
Else
    // Perform the necessary actions here

Method 2

// If extracted text is stored in a variable called "extractedText"

isTextPresent= extractedText.Contains("GL Account 2005 is relevant to Taxcode") Or extractedText.Contains("GL Account 1008 is relevant to Taxcode")
Data Type of isTextPresent= System.Boolean

//you can use isTextPresent to perform the necessary actions here

Method 3

  1. Use Text Exists activity in the workflow.
  2. In the Text options give the condition to check and store that in a variable. The output variable is of Type Boolean.

Hope it helps!!
Regards,

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