Set Configurations for a User BX24.userOption.set

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
BX24.userOption.set(string name, any value): void;
        

The BX24.userOption.set method sets the value of the value configuration with the name name for the current user. The value is applied immediately.

Arrays and objects are retained as part of the user configuration set. The set is serialized before writing and restored when read, so the structure can be retrieved using BX24.userOption.get.

Method Parameters

Required parameters are marked with *

Name
type

Description

name*
string

Parameter code

value*
any

Configuration value. You can pass a primitive value, array, or object

The method is intended for retaining small configuration values. Do not use it to retain large amounts of data.

Code Example

BX24.init(() => {
            BX24.userOption.set('param_str', 'str');
            BX24.userOption.set('param_numb', 1);
            BX24.userOption.set('param_obj', {foo: 'bar'});
        
            console.log(BX24.userOption.get('param_obj')); // returns {foo: 'bar'}
        });
        

How to Use Examples in Documentation

Response Handling

The method returns nothing. After the call, the retained value is available through BX24.userOption.get.

Error Handling

The method does not return error codes or accept a completion handler.

Continue Learning