1# @ohos.settings (Data Item Settings) (System API) 2 3The **settings** module provides APIs for setting data items. 4 5> **NOTE** 6> 7> - The initial APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. 8> - This topic describes only system APIs provided by the module. For details about its public APIs, see [@ohos.settings (Data Item Settings)](./js-apis-settings.md). 9 10## Modules to Import 11 12```js 13import settings from '@ohos.settings'; 14``` 15 16## domainName 17 18Describes the domain name. 19 20### Attributes 21 22**System capability**: SystemCapability.Applications.Settings.Core 23 24| Name | Type | Readable| Writable| Description | 25| ------------------- | ------ | ---- | ---- | ------------------------------------------------------------ | 26| USER_SECURITY<sup>11+</sup> | string | Yes | Yes | User security attribute domain. | 27 28## settings.setValue<sup>(deprecated)</sup> 29 30setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object, callback: AsyncCallback\<boolean>): void 31 32Sets the value for a data item. This API uses an asynchronous callback to return the result. 33 34> **NOTE** 35> 36> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setValue()](js-apis-settings.md#settingssetvalue10) instead. 37 38**System API**: This is a system API. 39 40**Model restriction**: This API can be used only in the FA model. 41 42**System capability**: SystemCapability.Applications.Settings.Core 43 44**Parameters** 45 46| Name | Type | Mandatory| Description | 47| ----------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 48| dataAbilityHelper | [DataAbilityHelper](../apis-ability-kit/js-apis-inner-ability-dataAbilityHelper.md) | Yes | **DataAbilityHelper** class. | 49| name | string | Yes | Name of the target data item. Data items can be classified as follows:<br>- Existing data items in the database<br>- Custom data items| 50| value | object | Yes | Value of the data item. The value range varies by service. | 51| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. Returns **true** if the operation is successful; returns **false** otherwise. | 52 53 54## settings.setValue<sup>(deprecated)</sup> 55 56setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object): Promise\<boolean> 57 58Sets the value for a data item. This API uses a promise to return the result. 59 60> **NOTE** 61> 62> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setValue()](js-apis-settings.md#settingssetvalue10-1) instead. 63 64**System API**: This is a system API. 65 66**Model restriction**: This API can be used only in the FA model. 67 68**System capability**: SystemCapability.Applications.Settings.Core 69 70**Parameters** 71 72| Name | Type | Mandatory| Description | 73| ----------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 74| dataAbilityHelper | [DataAbilityHelper](../apis-ability-kit/js-apis-inner-ability-dataAbilityHelper.md) | Yes | **DataAbilityHelper** class. | 75| name | string | Yes | Name of the target data item. Data items can be classified as follows:<br>- Existing data items in the database<br>- Custom data items| 76| value | object | Yes | Value of the data item. The value range varies by service. | 77 78**Return value** 79 80| Type | Description | 81| ----------------- | -------------------------------------------------- | 82| Promise\<boolean> | Promise used to return the result. Returns **true** if the operation is successful; returns **false** otherwise.| 83