Comparing the values of the array with each other

Hello!
I have array of integer elements.
I need to compare the values of the array with each other

array1 = [1,2,3,4,5] - false
array2 = [2,2,2,2,2] - true
array3 = [4,4,4,4,5] - false

How to do it in UiPath?

Solution

Hi @Olegik_Super,

Use if condition array1.distinct().length=1

Yes-> True
No-> False

Regards,
Arivu

2 Likes

Hi @Olegik_Super,

try below code,

arr.distinct.count=1

Regards,
Arivu

3 Likes

This worked.
Thank you!:wink:

you are welcome :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.