Skip to main content
Known Participant
Oct 19, 2021 4:43 PM UTC
Question

User Filter in Record

Hello All,

In the code snippet. the data is coming from a view configured.

The field sendingName_RSO contains a list of names and the field will hold more than one value.

Now I have added a user filter in the Record having a dropdown values of users from the constant defined.

When I give "includes" in the a!queryfield to get all the records assigned to a particular user, it gives the below error

Error Evaluating UI Expression
Expression evaluation error [evaluation ID = ad938:9cef1] in rule 'recordhomepage' (called by rule 'sitehomepage') : Cannot apply operator [INCLUDES] to field [sendingName_RSO] when comparing to value [TypedValue[it=4,v=firstname.lastname]].

I wanted to check if there any way we can pass "includes" or "in" in the a!queryfilter in an record user filter.

a!localVariables(
local!sendingRSO: getdistinctusers(cons!ALL_GROUPS[1]),
a!recordFilterList(
name: "Sending RSO",
options: a!forEach(
items: local!sendingRSO,
expression: a!recordFilterListOption(
id: fv!index,
name: fv!item,
filter: a!queryFilter(
field: 'recordType!{recordName}Request.fields.{sendingName_RSO}sendingName_RSO',
operator: "=",
value: fv!item
)
)
),
allowMultipleSelections: true()
)
)

3 replies

danny.verb
Employee
Oct 19, 2021 6:05 PM UTC

On line 13, wrap 'fv!item' in tostring()

Known Participant
Oct 20, 2021 4:34 AM UTC

This works and thank you very much for the solution.

csteward
Brainy
Oct 19, 2021 7:07 PM UTC

To add, we see this regularly with loosely-typed local variables.  Some functions are better at type casting than others, so as Danny mentions if you force to string type with fn!tostring(), should be good to go.