1# @ohos.application.formBindingData (formBindingData) 2 3The **FormBindingData** module provides APIs for widget data binding. You can use the APIs to create a **FormBindingData** object and obtain related information. 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8> This module is deprecated since API version 9. You are advised to use [FormBindingData](js-apis-app-form-formBindingData.md) instead. 9## Modules to Import 10 11```ts 12import formBindingData from '@ohos.application.formBindingData'; 13``` 14 15## FormBindingData 16 17Describes a **FormBindingData** object. 18 19**System capability**: SystemCapability.Ability.Form 20 21| Name| Type| Mandatory| Description| 22| -------- | -------- | -------- | -------- | 23| data | Object | Yes| Data to be displayed on the JS widget. The value can be an object containing multiple key-value pairs or a string in JSON format.| 24 25 26## createFormBindingData 27 28createFormBindingData(obj?: Object | string): FormBindingData 29 30Creates a **FormBindingData** object. 31 32**System capability**: SystemCapability.Ability.Form 33 34**Parameters** 35 36| Name| Type | Mandatory| Description | 37| ------ | -------------- | ---- | ------------------------------------------------------------ | 38| obj | Object\|string | No | Data to be displayed on the JS widget. The value can be an object containing multiple key-value pairs or a string in JSON format. The image data is identified by **'formImages'**, and the content is multiple key-value pairs, each of which consists of an image identifier and image file descriptor. The final format is {'formImages': {'key1': fd1, 'key2': fd2}}.| 39 40 41**Return value** 42 43| Type | Description | 44| ----------------------------------- | --------------------------------------- | 45| [FormBindingData](#formbindingdata) | **FormBindingData** object created based on the passed data.| 46 47 48**Example** 49 50```ts 51import featureAbility from '@ohos.ability.featureAbility'; 52import fileio from '@ohos.fileio'; 53let context=featureAbility.getContext(); 54context.getOrCreateLocalDir((err,data)=>{ 55 let path=data+'/xxx.jpg'; 56 let fd = fileio.openSync(path); 57 let obj = { 58 'temperature': '21°', 59 'formImages': {'image': fd} 60 }; 61 let formBindingDataObj = formBindingData.createFormBindingData(obj); 62}); 63``` 64