P
P
photosho2017-08-08 12:09:33
1C-Bitrix
photosho, 2017-08-08 12:09:33

How to filter by custom field of "List" type?

I'm trying to get a list of users (CUser::getList()) filtered by the value of a custom field of the "List" type. For example, you need to get all users for whom the field value fully corresponds to this array: [1, 3, 4]. Is there a possibility to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Luchnikov, 2017-08-08
@lu4nik

try to simply pass an array of values ​​to the filter by this field, something like

$usersIterator = \CUser::GetList(
    $by = 'ID',
    $order = 'ASC',
    [
        'UF_LIST' => [1, 3, 4],
    ]
);

Should work. The name of the field should be replaced by your own.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question