1

I to choose a list-value via the API into Bitrix

CRest::call('lists.element.add',
        [ 'IBLOCK_TYPE_ID' => 'lists',
         'IBLOCK_ID' => '134',
         'ELEMENT_CODE' => 'element'.$entry[134] ,
         'FIELDS' => [
         'NAME' =>  'TEST'.$leadID, 
         'PROPERTY_1430' => 'YES or NO' ,
         ]
        ]             

Ho do i set the Value for Protpery_1430? Here "Yes or NO"

There is a screenshot of the values of the Ja (Yes) and (NO): There is a screenshot of the values of the Ja (Yes) and (NO

Some help would be nice :) Roland

Mohammad Fanni
  • 4,095
  • 3
  • 28
  • 52
Roland Kom
  • 13
  • 2

1 Answers1

2

Just pass the list variant identifier; e.g.:

CRest::call('lists.element.add', [
    'IBLOCK_TYPE_ID' => 'lists',
    'IBLOCK_ID' => '134',
    'ELEMENT_CODE' => 'element'.$entry[134] ,
    'FIELDS' => [
        'NAME' =>  'TEST'.$leadID, 
        'PROPERTY_1430' => 2463, // or 2464
    ]
];

If you can't use identifiers and need to use values, use the lists.field.get method and find the identifier by the value from the DISPLAY_VALUES_FORM field.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Sergey Panteleev
  • 122
  • 1
  • 1
  • 10