Box Developer Documentation

Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

Float metadata field

Float metadata field

A metadata field of type float is displayed to a user as a standard text-field that only accepts numeric input.

String field

Create a float field

A float field can be added to a metadata template either when creating a metadata template, or when updating a template with the addField operation.

The required attributes for a float field are a type, a displayName, and a key.

{
  "scope": "enterprise",
  "displayName": "Contract",
  "fields": [
    {
      "type": "float",
      "key": "contract_value",
      "displayName": "Contract Value",
      "description": "The contract's total value",
      "hidden": false
    }
  ]
}

Optionally, a description can be provided that is shown to a user in the UI, and the field can be set to hidden to hide it from users in the web and mobile apps.

Update a float field

A float template field can be updated by updating the template it belongs to. Updates to templates happen through operations to ensure that any template that is already assigned to a file or folder is updated as well.

When updating a float metadata field, the only relevant operation is the editField operation, which can be used to change the field's key, displayName, description, and hidden values.

[
  {
    "op": "editField",
    "fieldKey": "contract_value",
    "data": {
      "displayName": "Total Annual Contract Value",
      "description": "The contract's total anual value",
      "key": "contract_tav",
      "hidden": true
    }
  }
]

This will affect existing instances of this template.