0

I am new to UI path and am trying to build a workflow/sequence to check if a field in my desktop application is filled or not.

If the field is empty then I want to proceed with the process, and if it is filled I want it to be marked as an exception.

I currently have it so the flow goes as follows: 1. Identified element 2. used Text Exists activity for that field, and I inputed "" as the Text

What are the next steps?

2 Answers2

0

It would be better if you used Get Text command, and using if condition, check if the text is null or empty and take action.

KhaledMostafaMe
  • 572
  • 5
  • 9
0

First you want to use Get text on the Text box to extract its contents and store this in a variable in UiPath (Note: if you create the variable from the side properties panel it will give it the type GenericValue, you'll want to change this to String)

Next depends an what you mean by filled:

If you want to accept spaces as been filled then you can use String.IsNullOrEmpty(YOUR_VARIABLE)

If you want the filed to be filled with characters that aren't spaces you can use String.IsNullOrWhiteSpace(YOUR_VARIABLE)

for your exception it will depend on weather you want to throw it as an

  • Application exception (new System.Exception("EXCEPTION MESSAGE"))

or

  • Businessexception (new UiPath.Core.BusinessRuleException("EXCEPTION MESSAGE"))

So your workflow will want to look something like this enter image description here

Conor
  • 736
  • 1
  • 13
  • 33