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
367 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
• 13,960 points

Related Questions In RPA

0 votes
1 answer
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 in RPA by Abha
• 27,180 points
107 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,459 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,441 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,170 points
662 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
432 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
• 27,180 points
1,165 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
2,385 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
• 13,960 points
2,476 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
• 13,960 points
296 views