UiFormatSpecificationSet

Represents a set of rules that define the style and visibility of conditional field formatting on Dynamic Forms-enabled Lightning page field instances.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type

This type extends the Metadata metadata type and inherits its fullName field.

A UiFormatSpecificationSet is referred to as a conditional formatting ruleset in the rest of the Salesforce documentation and UI.

Note

File Suffix and Directory Location

UiFormatSpecificationSet components have the suffix .uiFormatSpecificationSet and are stored in the uiFormatSpecificationSets folder.

Version

UiFormatSpecificationSet components are available in API version 62.0 and later.

Special Access Rules

There are no additional access requirements that are specific to this type.

Fields

Field Name Description
field
Field Type
string
Description

Required. The object field that the conditional formatting is associated with.

formatType
Field Type
FormatType (enumeration of type string)
Description

Required. The type of conditional formatting associated with the field.

Values are:

  • ICON
masterLabel
Field Type
string
Description

Required. The label for the conditional formatting ruleset, which displays in Setup.

sobjectType
Field Type
string
Description

Required. The object the ruleset is associated with.

uiFormatSpecifications
Field Type
UiFormatSpecification[]
Description
The list of rules contained in the ruleset.

UiFormatSpecification

A single rule in the ruleset.

Field Name Description
formatProperties
Field Type
string
Description

Required. The properties for a given formatType in JSON format.

formatType
Field Type
FormatType (enumeration of type string)
Description

Required. The type of conditional formatting associated with the field when the rule evaluates to true.

Values are:

  • ICON
order
Field Type
int
Description

Required. A numerical value representing the conditional formatting rule’s position in the evaluation order.

visibilityRule
Field Type
UiFormulaRule
Description
A set of one or more filters that define the conditions under which the conditional formatting appears on the field.

If the visibility rule evaluates to true, the formatting displays on the field. If false, it doesn’t display. If this field is null, the formatting displays by default.

UiFormulaRule

A set of one or more filters that define the conditions under which conditional field formatting displays on a Dynamic Forms-enabled Lightning page field instance. For example, you could construct a filter that causes conditional formatting to display only when the Amount field is greater than $1,000,000.

Field Name Description
booleanFilter
Field Type
string
Description
Specifies advanced filter conditions such as 1 AND 2.
criteria
Field Type
UiFormulaCriterion[]
Description
List of one or more filters that, when evaluated, determine conditional field formatting visibility.

UiFormulaCriterion

A single filter that when evaluated, helps define conditional formatting visibility on a Dynamic Forms-enabled Lightning page field instance.

Field Name Description
leftValue
Field Type
string
Description
Required. The field upon which the filter is based. For example, AMOUNT.
operator
Field Type
string
Description
Required. Defines the operator used to filter the data. Valid values are:
  • CONTAINS
  • EQUAL
  • NE—not equal
  • GT—greater than
  • GE—greater than or equal
  • LE—less than or equal
  • LT—less than
rightValue
Field Type
string
Description
The value by which you want to evaluate the formatting visibility. For example, 1000000.

Declarative Metadata Sample Definition

The following is an example of an UiFormatSpecificationSet component.

<?xml version="1.0" encoding="UTF-8"?>
<UiFormatSpecificationSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <field>Contact.Customer_Sentiment__c</field>
    <formatType>ICON</formatType>
    <masterLabel>Sentiment Score</masterLabel>
    <sobjectType>Contact</sobjectType>
    <uiFormatSpecifications>
        <formatProperties>{&quot;icon&quot;:&quot;happy_face&quot;,
&quot;iconColor&quot;:&quot;green&quot;}</formatProperties>
        <formatType>ICON</formatType>
        <order>1</order>
        <visibilityRule>
            <criteria>
                <leftValue>{!Record.Customer_Sentiment__c}</leftValue>
                <operator>EQUAL</operator>
                <rightValue>Happy</rightValue>
            </criteria>
        </visibilityRule>
    </uiFormatSpecifications>
    <uiFormatSpecifications>
        <formatProperties>{&quot;icon&quot;:&quot;neutral_face&quot;,
&quot;iconColor&quot;:&quot;gray&quot;}</formatProperties>
        <formatType>ICON</formatType>
        <order>2</order>
        <visibilityRule>
            <criteria>
                <leftValue>{!Record.Customer_Sentiment__c}</leftValue>
                <operator>EQUAL</operator>
                <rightValue>Neutral</rightValue>
            </criteria>
        </visibilityRule>
    </uiFormatSpecifications>
    <uiFormatSpecifications>
        <formatProperties>{&quot;icon&quot;:&quot;sad_face&quot;,
&quot;iconColor&quot;:&quot;red&quot;}</formatProperties>
        <formatType>ICON</formatType>
        <order>3</order>
        <visibilityRule>
            <criteria>
                <leftValue>{!Record.Customer_Sentiment__c}</leftValue>
                <operator>EQUAL</operator>
                <rightValue>Unhappy</rightValue>
            </criteria>
        </visibilityRule>
    </uiFormatSpecifications>
</UiFormatSpecificationSet>

The following is an example package.xml that references the previous definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Sentiment_Score</members>
        <name>UiFormatSpecificationSet</name>
    </types>
    <version>62.0</version>
</Package>

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.