[RPA] Conditional Assigns in UiPath – Using The Shorthand IF Statement

Level of Difficulty: Beginner.

Have you ever wanted to assign a variable based on the value of another variable but… Without the use of an IF statement block? Here’s how to achieve that.

Let’s take an example… We have a boolean variable, named UnicornsExist which can be set by the user through an input dialog. Based on the value of UnicornsExist, we will print either “This is optimal” if the value is true or “This is not optimal” if the value is false.

Your sequence should look something like this:

UiPath Shorthand If Statement

The syntax of the shorthand if statement is as follows:

IF (<Condition>, <When True>, <When False>)

So in the context of the example outlined above, the if statement would be the following:

IF (UnicornsExist, "This is optimal", "This is not optimal")

The code to this solution is available on GitHub, here.

Published by Jacqui Muller

I am an application architect and part time lecturer by current professions who enjoys dabbling in software development, RPA, IOT, advanced analytics, data engineering and business intelligence. I am aspiring to complete a PhD degree in Computer Science within the next three years. My competencies include a high level of computer literacy as well as programming in various languages. I am passionate about my field of study and occupation as I believe it has the ability and potential to impact lives - both drastically and positively. I come packaged with an ambition to succeed and make the world a better place.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: