MetadataCheckboxes - adobe-dmeservices/custom-metadata GitHub Wiki

Checkbox and Checkbox Group Fields

Checkbox fields allow users to select one of two predefined values.

  • You can configure the values in the Options tab.

  • Checkbox fields require two values, defined as an object. This must include an unchecked state value and a checked state value. In many cases, the unchecked state is "". The selected value will be written to XMP. In the example below, when the user checks the box, the value "True" will be written to XMP, and when the user unchecks the box, the value "False" will be written to XMP.

    {
    	"checked": "True",
    	"unchecked": "False"
    }
    

    In the next example, when a user checks the box, the value "Red" will be written to XMP. When the user unchecks the box, the value will be removed from XMP.

    {
    	"checked": "Red",
    		"unchecked": ""
    }
    
  • The checkbox will show a dash if there is no defined value for the property and the unchecked value is not an empty string. Additionally, the checkbox will turn red if the set value is not one of the two predefined values.

Checkbox Group fields allow users to select one of many predefined values.

  • You can configure the values in the Options tab.
  • Options must be defined as an array, each entry containing an object with a label and a value. The selected value will be written to XMP. In the example below, if a user chooses option "Two," then "2" will be written to XMP. If the user chooses options "Two" and "Three," then "2" and "3" will be added to the bag in XMP.
[
	{
		"label": "One",
		"value": "1"
	},
	{
		"label": "Two",
		"value": "2"
	},
	{
		"label": "Three",
		"value": "3"
	}
]

Know that the user must take action in order for a value to be written to XMP.

Note: Checkboxes in Checkbox Groups behave differently than standalone checkboxes, in that they do not have a value when unchecked.

Dependencies

You can optionally use Dependencies to set one or more fields that must have data before a user can enter data in this field. This field will be disabled until there is a value present in the field you specify in Dependencies. Learn more about Dependencies

  • To configure, choose one or more fields from the Dependencies dropdown in the Advanced tab. The dropdown will display all currently defined fields, so you will need to define fields before you can use them as Dependencies for other fields.