I have a Bug when i inserted Contain operator inside Filter Function

Hello,
Can I know is this the right way to use Combination of Contain operator with Filter Function.
As u can see, I tried with Both ways.
f1 ----- f2

is this correct way to use Combination of Contain operator with Filter. here filter function is used with custom list Control and the filter function depends on value from dropdown control.

filter function only works when I change the value in dropdown control once and change it back. then if I change value again in drop down means it wont. work.

Thanks

1 Like

Hi @RpaNoobMax,

In UiPath, the Filter function allows you to filter a collection of objects based on a specified condition. The syntax of the Filter function is as follows:

Filter(collection, condition)

Here, collection is the collection of objects that you want to filter, and condition is the condition that you want to apply to each object in the collection.

To use the Contain operator inside the Filter function, you can use the following syntax:

Filter(collection, "property_name.Contains('value')")

Here, property_name is the name of the property that you want to check for the presence of the value, and value is the value that you want to search for. Note that the Contains method is called on the property_name to check if the value is present.

For example, if you have a collection of strings and you want to filter out all the strings that contain the word “apple”, you can use the following Filter function:

Filter(myCollection, "ToString().Contains('apple')")

Here, myCollection is the collection of strings that you want to filter, and ToString() is used to convert each string object to a string so that the Contains method can be called on it. The Contains method will return true if the string contains the word “apple”.

Can you please give a try on above.

Thanks @ABHIMANYU_THITE1 for reply. I am having problem with UiPath Apps Filter function. Function: Filter

It looks like this is a choice set. Data-service doesn’t support the in operator for choice set columns, but contains should work for a single item. You cannot use multiple items with contains (which is what it looks like in this screenshot).

You might want to double check that the left-hand side of contains (in your case User Access Max.Access Type) is the right property - you might want to be using User Access Max.Selected Access Type. Hope this helps!