S
S
Sergey2021-04-01 16:32:24
1C-Bitrix
Sergey, 2021-04-01 16:32:24

How to filter in Bitrix24 by several keys?

Good afternoon.

There is a task to select products in Bitrix24 by name:
1) When I do a search by full name - it works, even if I write 1 word (which is in the product names) - it gives me a whole bunch of them.
2) But if I want to search by multiple keys - it doesn't work, I can't figure out why - either my curve code or the system doesn't have such functionality?

# Рабочий пример:
  $TestArray = Array(
    "111",
    "222",
  );
  $search_product = \App\CRest::call('crm.product.list', [
      "order"  => [],
      "filter" => [
        "CATALOG_ID" => 14,
        "NAME" => $TestArray,
      ],
      "select" => ["ID", "NAME", "PROPERTY_112"],
    ]
  );
  print_r($search_product);


# Нерабочий пример

  $TestArray = Array(
    array(
      "1",
      "2",
    ),
    "333", 
  );
  $search_product = \App\CRest::call('crm.product.list', [
      "order"  => [],
      "filter" => [
        "CATALOG_ID" => 14,
        "NAME" => $TestArray,
      ],
      "select" => ["ID", "NAME", "PROPERTY_112"],
    ]
  );
  print_r($search_product);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question