Having trouble checking if a variable = a bunch of integers

I am trying to do the following

if
PMCount = 75 or 100 or 125 or 150 or 175 (etc…)
then …

Although this obviously does not work? I tried putting all the numbers in a array variable, and it still did not work.

How can I accomplish this?

first, make sure that PMCount is also an integer.

1 Like

@Sami_Syed

If you are having all Integers in an array then why you are using Or in If Condition. Just give
Array_Variable.Contains(PMCount)

Actually

you have to put condition like this , if you want to use Or Condition

PMCount = 75 or PMCount = 100 or PMCount = 125 or PMCount =150 or PMCount =175

Regards,
Mahesh

3 Likes

Hey @Sami_Syed
You could put all the values,ie, 75,100,125 etc in an Int32 type array
then use a for each to iterate through this array and inside it, check if PMCount(which must be a Int32 type variable) is equal to item(which is the int variable of for each) then print something or take the desired action and then break out of the loop with the help of break activity

Regards.

1 Like

Hello @Sami_Syed
first create an Array with values 75, 100, 125 etc then in condition write this
yourArrayName.contains(PMcount.tostring)

2 Likes

Thank you everyone. All the solutions worked!