Documentation

iblock.Element.list

iblock.Element.list(iblockId, select, filter, order, pageNavigation)

Method gets iblock elements by specified filter.

Parameters

ParameterDescription
iblockIdIblock ID. Required parameter.
selectSet of fields and properties for retrieval. You can get the fields 'ID', 'NAME', 'IBLOCK_SECTION_ID' from the method getElementEntityAllowedList and all iblock properties.

Note If you need to get other fields, you can create a custom controller.

filterArray with filter parameters, accepted by the method \Bitrix\Main\ORM\Query\Filter\ConditionTree::createFromArray. Format for such filter is described in the Bitrix Framework learning course.
orderArray with sorting format ['FIELD1' => 'ASC', 'FIELD2' => 'DESC'].
pageNavigationStandard REST page navigation based at \Bitrix\Main\UI\PageNavigation.
Result format:
{
    "result":
    {
        "elements":
        [
            {
                "ID":123,
                "NAME":"...",
                "SOME_PROPERTY":
                [
                    {
                        "ID":456,
                        "VALUE":"...",
                        "DESCRIPTION":""
                    },
                ]
            }
        ]
    },
    "total":1
}


© «Bitrix24», 2001-2024
Up