PropertyValue
Struct for a single property value.
| Name | Description | Type |
|---|---|---|
property_def | Property definition ID. | number |
value | The value of the property. | TypedValue |
Helper Methods and Properties
⚠️ Note
These helper methods and properties are available when using the npm package @m-filescorporation/uix-vault-messages. Install it in your project to use these helpers. For more information, see Overview/VaultMessages/.
Factory Methods
| Method | Description | Parameters | Returns |
|---|---|---|---|
Create | Creates a new PropertyValue. | propertyDef: number type: Datatype value: TypedValueValueMap[T] | PropertyValue |
CreateWithTypedValue | Creates a new PropertyValue with a TypedValue. | propertyDef: number value: TypedValue | PropertyValue |
Text | Creates a new PropertyValue of type Text. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_TEXT] | PropertyValue |
Float | Creates a new PropertyValue of type Real Number (Float). | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_REAL_NUMBER] | PropertyValue |
Bool | Creates a new PropertyValue of type Boolean. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_BOOLEAN] | PropertyValue |
Lookup | Creates a new PropertyValue of type Lookup. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_LOOKUP] | PropertyValue |
Date | Creates a new PropertyValue of type Date. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_DATE] | PropertyValue |
Timestamp | Creates a new PropertyValue of type Timestamp. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_TIMESTAMP] | PropertyValue |
MultiLookup | Creates a new PropertyValue of type Multi-Select Lookup. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_MULTI_SELECT_LOOKUP] | PropertyValue |
Int | Creates a new PropertyValue of type Integer. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_INTEGER] | PropertyValue |
MultiText | Creates a new PropertyValue of type Multi-Line Text. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_MULTI_LINE_TEXT] | PropertyValue |
Time | Creates a new PropertyValue of type Time. | propertyDef: number value: TypedValueValueMap[Datatype.DATATYPE_TIME] | PropertyValue |
Instance Methods
| Method | Description | Parameters | Returns |
|---|---|---|---|
SetText | Set the text value. | value: TypedValueValueMap[Datatype.DATATYPE_TEXT] | void |
SetMultiText | Set the multi-line text value. | value: TypedValueValueMap[Datatype.DATATYPE_MULTI_LINE_TEXT] | void |
SetBool | Set the boolean value. | value: TypedValueValueMap[Datatype.DATATYPE_BOOLEAN] | void |
SetInt | Set the integer value. | value: TypedValueValueMap[Datatype.DATATYPE_INTEGER] | void |
SetDate | Set the date value. | value: TypedValueValueMap[Datatype.DATATYPE_DATE] | void |
SetLookup | Set the lookup value. | value: TypedValueValueMap[Datatype.DATATYPE_LOOKUP] | void |
SetFloat | Set the float (real number) value. | value: TypedValueValueMap[Datatype.DATATYPE_REAL_NUMBER] | void |
SetMultiLookup | Set the multi-select lookup value. | value: TypedValueValueMap[Datatype.DATATYPE_MULTI_SELECT_LOOKUP] | void |
SetTime | Set the time value. | value: TypedValueValueMap[Datatype.DATATYPE_TIME] | void |
SetTimestamp | Set the timestamp value. | value: TypedValueValueMap[Datatype.DATATYPE_TIMESTAMP] | void |
Creating Objects
// Creates a new PropertyValue.
const result = PropertyValue.Create(0, 0);
// Creates a new PropertyValue with a TypedValue.
const result = PropertyValue.CreateWithTypedValue(
0,
TypedValue.Text("example text"),
);
// Creates a new PropertyValue of type Text.
const result = PropertyValue.Text(0, "example text");
// Creates a new PropertyValue of type Real Number (Float).
const result = PropertyValue.Float(0, 42);
// Creates a new PropertyValue of type Boolean.
const result = PropertyValue.Bool(0, true);
// Creates a new PropertyValue of type Lookup.
const result = PropertyValue.Lookup(0, new Lookup());
// Creates a new PropertyValue of type Date.
const result = PropertyValue.Date(0, new Date());
// Creates a new PropertyValue of type Timestamp.
const result = PropertyValue.Timestamp(0, new Date());
// Creates a new PropertyValue of type Multi-Select Lookup.
const result = PropertyValue.MultiLookup(0, []);
// Creates a new PropertyValue of type Integer.
const result = PropertyValue.Int(0, 42);
// Creates a new PropertyValue of type Multi-Line Text.
const result = PropertyValue.MultiText(0, "example text");
// Creates a new PropertyValue of type Time.
const result = PropertyValue.Time(0, new Date());
Working with Objects
// Extension helpers for PropertyValue instances
// Set the text value.
const result = propertyvalueInstance.SetText("example text");
// Set the multi-line text value.
const result = propertyvalueInstance.SetMultiText("example text");
// Set the boolean value.
const result = propertyvalueInstance.SetBool(true);
// Set the integer value.
const result = propertyvalueInstance.SetInt(42);
// Set the date value.
const result = propertyvalueInstance.SetDate(new Date());
// Set the lookup value.
const result = propertyvalueInstance.SetLookup(new Lookup());
// Set the float (real number) value.
const result = propertyvalueInstance.SetFloat(42);
// Set the multi-select lookup value.
const result = propertyvalueInstance.SetMultiLookup([]);
// Set the time value.
const result = propertyvalueInstance.SetTime(new Date());
// Set the timestamp value.
const result = propertyvalueInstance.SetTimestamp(new Date());
Example
{
"property_def": 0,
"value": {
"is_null_value": false,
"type": 15 /* Enum: Datatype */,
"data": {
"acl": {
"checked_out_to_user": 0,
"is_fully_authoritative": false,
"custom_component": {
"named_acl_id": 0,
"has_named_acl": false,
"current_user_id": 0,
"has_current_user": false,
"permissions": [] /* Array of AccessControlEntry */,
"overridability_permissions": [] /* Array of AccessControlEntry */,
"status": {
"all": false,
"deleted": false,
"source_item_linked_via_pseudo_users": false
}
},
"restrictive_components": [] /* Array of AccessControlListComponentMapEntry */,
"secondary_access_control_list": {} /* AccessControlList */,
"additive_components": [] /* Array of AccessControlListComponentMapEntry */
}
}
}
}