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 in RPA by Sanjiv
80 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 by Anvi
• 10,310 points

Related Questions In RPA

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,090 points
1,915 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,090 points
1,036 views
0 votes
1 answer

How to go to next tab in windows GUI in uipath

You can send Ctrl + Tab for each tab READ MORE

answered May 22, 2018 in RPA by wrecker
• 3,090 points
306 views
0 votes
1 answer

how to expand toggle/hyperlink while data scraping in UiPath?

After having looked the page over, it ...READ MORE

answered May 24, 2018 in RPA by wrecker
• 3,090 points
80 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 in RPA by darklord
• 6,140 points
377 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 in RPA by Mishti
• 480 points
181 views
0 votes
1 answer

Write multiple line message using message box

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

answered Mar 4 in RPA by Abha
• 16,440 points
340 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 in RPA by Mishti
• 480 points
901 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 in RPA by Anvi
• 10,310 points
614 views
0 votes
1 answer

How to install Citrix Extension in UiPath?

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

answered Mar 6 in RPA by Anvi
• 10,310 points
122 views