Hello! Can you please tell me how to get the XML_ID value from a custom property?

I created an information block, then I create sections in it, since these sections will not only store elements but also certain values. It became necessary to create a new user field that stores certain values. Using the code below, we got the ID of the list values. And how to get the value of XML_ID?

There used to be a similar question , but there the question referred to information blocks, and here it is a user property.

CModule::IncludeModule('iblock'); $arSelect = Array('ID', 'NAME', 'UF_TF'); $arFilter = Array('IBLOCK_ID'=>$iblock, 'ACTIVE'=>'Y', 'GLOBAL_ACTIVE'=>'Y'); $res = CIBlockSection::GetList(Array('SORT'=>'ASC'), $arFilter, true, $arSelect); while($ob = $res->GetNext()) { ?> <div> <?=$ob['UF_TF'] ?> </div> <?}?> 

In nesting screenshots can help in understanding the issue. Thank you in advance.

alt text

alt text

alt text

    1 answer 1

    Friends, and again received a response from technical support, commenting if someone suddenly accidentally come in handy:

    You can get this way:

     Cmodule::IncludeModule('iblock'); $rsEnum = CUserFieldEnum::GetList(array(), array("ID" =>$ID));//$ID - id значения пользовательского поля типа список $arEnum = $rsEnum->GetNext(); echo $arEnum["XML_ID"]; 

    In my case it looks like this:

     <? if(isset($_GET["ID"]){ $newID = $_GET["ID"]; } CModule::IncludeModule('iblock'); $arSelect = Array('ID', 'NAME', 'UF_TF'); $arFilter = Array('IBLOCK_ID'=>$newID, 'ACTIVE'=>'Y', 'GLOBAL_ACTIVE'=>'Y'); $res = CIBlockSection::GetList(Array('SORT'=>'ASC'), $arFilter, true, $arSelect); while($ob = $res->GetNext()) { ?> <div> <? Cmodule::IncludeModule('iblock'); $rsEnum = CUserFieldEnum::GetList(array(), array("ID" =>$newID)); $arEnum = $rsEnum->GetNext(); echo $arEnum["XML_ID"]; ?> </div> <?}?> 
    • and how to filter by XML_ID properties PROPERTY_TF.XML_ID = 158 does not work - adeveloper
    • Whoo ... damn, I didn't understand the question ... what exactly is not working? - Artyomich