How to make If statement more compact in UiPath?

0 votes
I have a condition like City="Delhi" Or City="Pune" Or City="New York" or City="London", where I want to check if City is equal to any one of these names. But how can I compact this condition in If statement, as I don't want to use nested loops. Please suggest how to do that using UiPath.
Mar 18, 2019 in RPA by Sanjiv
660 views
I have already tried using OR in between the conditions in If statement, but that doesn't work.

1 answer to this question.

0 votes

Hey @Sanjiv, if you wish to compact a condition like this in If statement using UiPath, you can define a list of strings with your values like (Cities: {"Delhi", "Pune", "New York", "London"}) and use .Contains function of lists in If statement. For eg. Cities.Contains("Delhi") will return true as it is present in the list. Refer to the screenshot for understanding better:

answered Mar 18, 2019 by Anvi
• 14,010 points

Related Questions In RPA

0 votes
1 answer

How to get the desired packages in UiPath Studio if not available in Package Manager?

Steps to get your desired package in ...READ MORE

answered Oct 14, 2019 in RPA by Abha
• 27,740 points
111 views
0 votes
1 answer

How to make a text hyperlink in word using Uipath Studio?

Hi there, you can make a text ...READ MORE

answered Oct 24, 2019 in RPA by Abha
• 27,740 points
293 views
0 votes
1 answer

How to use Not contains function in string in UIPath?

you can use the following approach  strValue = ...READ MORE

answered May 16, 2018 in RPA by wrecker
• 3,110 points
2,616 views
0 votes
1 answer

How to select an item in UiPath that starts with a string

use a wildcard in selector. make sure that ...READ MORE

answered May 21, 2018 in RPA by wrecker
• 3,110 points
1,559 views
0 votes
1 answer

Identify a Column in a database in UiPath Studio

There are two options to identify a ...READ MORE

answered Feb 11, 2019 in RPA by Sahiti
• 6,290 points
802 views
0 votes
1 answer

Which edition of UiPath is more suitable for individual use, Enterprise Platform or Community Edition? Why?

UiPath’s Community Edition (CE) is the version which is ...READ MORE

answered Mar 7, 2019 in RPA by Mishti
• 480 points
527 views
0 votes
1 answer

Write multiple line message using message box

@Rashmi Message Box activity in UiPath does ...READ MORE

answered Mar 4, 2019 in RPA by Abha
• 27,740 points
1,762 views
0 votes
1 answer

How to connect to MySQL database using UiPath?

Follow these simple steps to connect to ...READ MORE

answered Mar 7, 2019 in RPA by Mishti
• 480 points
2,990 views
0 votes
1 answer

How to check if a string exists in datatable using UiPath?

Hi @Ravi, to check whether a string ...READ MORE

answered Mar 18, 2019 in RPA by Anvi
• 14,010 points
3,389 views
0 votes
1 answer

How to install Citrix Extension in UiPath?

Hi Avnish, to install CItrix Entension in ...READ MORE

answered Mar 6, 2019 in RPA by Anvi
• 14,010 points
357 views