Add Storage Element entity.item.add

We are still updating this page

Some data may be missing — we will fill it in shortly.

Scope: entity

Who can execute the method: any user

The method entity.item.add adds a storage element. The user must have at least write access permission (W) in the storage.

Parameters

Parameter

Description

ENTITY*
string

Required. String identifier of the storage.

NAME*
string

Required. Name of the element.

ACTIVE
unknown

Element active flag (Y|N).

DATE_ACTIVE_FROM
unknown

Start date of the element's activity.

DATE_ACTIVE_TO
unknown

End date of the element's activity.

SORT
unknown

Sorting weight of the element.

PREVIEW_PICTURE
unknown

Preview image of the element. How to upload a file in the field is described in the article How to upload files.

PREVIEW_TEXT
unknown

Preview text of the element.

DETAIL_PICTURE
unknown

Detailed image of the element. How to upload a file in the field is described in the article How to upload files.

DETAIL_TEXT
unknown

Detailed text of the element.

CODE
unknown

Symbolic code of the element.

SECTION
unknown

Identifier of the storage section.

PROPERTY_VALUES
unknown

Associative list of property values of the element. Storage properties are created using entity.item.property.add.

Required parameters are marked with *

Example

try
        {
        	const response = await $b24.callMethod(
        		'entity.item.add',
        		{
        			ENTITY: 'menu_new',
        			DATE_ACTIVE_FROM: new Date(),
        			DETAIL_PICTURE: '',
        			NAME: 'Hello, world!',
        			PROPERTY_VALUES: {
        				test: 11,
        				test1: 22,
        				test_file: ''
        			},
        			SECTION: 219
        		}
        	);
        	
        	const result = response.getData().result;
        	// Your required data processing logic
        	processResult(result);
        }
        catch( error )
        {
        	console.error('Error:', error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'entity.item.add',
                    [
                        'ENTITY'          => 'menu_new',
                        'DATE_ACTIVE_FROM' => new DateTime(),
                        'DETAIL_PICTURE'  => '',
                        'NAME'            => 'Hello, world!',
                        'PROPERTY_VALUES' => [
                            'test'     => 11,
                            'test1'    => 22,
                            'test_file' => ''
                        ],
                        'SECTION'         => 219
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . print_r($result, true);
            // Your required data processing logic
            processData($result);
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error adding entity item: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'entity.item.add',
            {
                ENTITY: 'menu_new',
                DATE_ACTIVE_FROM: new Date(),
                DETAIL_PICTURE: '',
                NAME: 'Hello, world!',
                PROPERTY_VALUES: {
                    test: 11,
                    test1: 22,
                    test_file: ''
                },
                SECTION: 219
            }
        );
        
https://my.bitrix24.com/rest/entity.item.add.json?DATE_ACTIVE_FROM=2013-06-26T11%3A54%3A30.421Z&DETAIL_PICTURE=&ENTITY=menu_new&NAME=Hello%2C%20world!&PROPERTY_VALUES%5Btest1%5D=22&PROPERTY_VALUES%5Btest%5D=11&PROPERTY_VALUES%5Btest_file%5D=&SECTION=219&auth=9affe382af74d9c5caa588e28096e872
        

How to Use Examples in Documentation

Response on Success

200 OK

{"result":842}