UiFormatSpecificationSet

Represents a set of rules that define the style and visibility of conditional field formatting on Dynamic Forms-enabled Lightning page field instances. A UiFormatSpecificationSet is referred to as a conditional formatting ruleset in the rest of the Salesforce documentation and UI.

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 Metadata and inherits its fields.

File Suffix and Directory Location 

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

Version 

Introduced in API version 62.0.

Special Access Rules 

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

Fields 

field 

  • Type: string
  • Required: Yes
  • Description: Required. The object field that the conditional formatting is associated with.

formatType 

  • Type: FormatType (enumeration of type string)

  • Required: Yes

  • Description: Required. The type of conditional formatting associated with the field.

    Values are:

  • Possible values:

    • ICON

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. The label for the conditional formatting ruleset, which displays in Setup.

sobjectType 

  • Type: string
  • Required: Yes
  • Description: Required. The object the ruleset is associated with.

uiFormatSpecifications 

UiFormatSpecification Type 

A single rule in the ruleset.

Fields 

formatProperties 

  • Type: string
  • Required: Yes
  • Description: Required. The properties for a given formatType in JSON format.

formatType 

  • Type: FormatType (enumeration of type string)

  • Required: Yes

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

    Values are:

  • Possible values:

    • ICON

order 

  • Type: int
  • Required: Yes
  • Description: Required. A numerical value representing the conditional formatting rule’s position in the evaluation order.

visibilityRule 

  • Type: UiFormulaRule

  • Required: No

  • 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.

UiFormulaCriterion Type 

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

Fields 

leftValue 

  • Type: string
  • Required: Yes
  • Description: Required. The field upon which the filter is based. For example, AMOUNT.

operator 

  • Type: string (enumeration of type string)
  • Required: Yes
  • Description: Required. Defines the operator used to filter the data.
  • Possible values:
    • CONTAINS
    • EQUAL
    • NE — not equal
    • GT — greater than
    • GE — greater than or equal
    • LE — less than or equal
    • LT — less than

rightValue 

  • Type: string
  • Required: No
  • Description: The value by which you want to evaluate the formatting visibility. For example, 1000000.

UiFormulaRule Type 

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.

Fields 

booleanFilter 

  • Type: string
  • Required: No
  • Description: Specifies advanced filter conditions such as 1 AND 2.

criteria 

  • Type: UiFormulaCriterion[]
  • Required: No
  • Description: List of one or more filters that, when evaluated, determine conditional field formatting visibility.

Declarative Metadata Sample Definition 

The following is an example of an UiFormatSpecificationSet component.

1<?xml version="1.0" encoding="UTF-8"?>
2<UiFormatSpecificationSet xmlns="http://soap.sforce.com/2006/04/metadata">
3    <field>Contact.Customer_Sentiment__c</field>
4    <formatType>ICON</formatType>
5    <masterLabel>Sentiment Score</masterLabel>
6    <sobjectType>Contact</sobjectType>
7    <uiFormatSpecifications>
8        <formatProperties>{&quot;icon&quot;:&quot;happy_face&quot;,
9&quot;iconColor&quot;:&quot;green&quot;}</formatProperties>
10        <formatType>ICON</formatType>
11        <order>1</order>
12        <visibilityRule>
13            <criteria>
14                <leftValue>{!Record.Customer_Sentiment__c}</leftValue>
15                <operator>EQUAL</operator>
16                <rightValue>Happy</rightValue>
17            </criteria>
18        </visibilityRule>
19    </uiFormatSpecifications>
20    <uiFormatSpecifications>
21        <formatProperties>{&quot;icon&quot;:&quot;neutral_face&quot;,
22&quot;iconColor&quot;:&quot;gray&quot;}</formatProperties>
23        <formatType>ICON</formatType>
24        <order>2</order>
25        <visibilityRule>
26            <criteria>
27                <leftValue>{!Record.Customer_Sentiment__c}</leftValue>
28                <operator>EQUAL</operator>
29                <rightValue>Neutral</rightValue>
30            </criteria>
31        </visibilityRule>
32    </uiFormatSpecifications>
33    <uiFormatSpecifications>
34        <formatProperties>{&quot;icon&quot;:&quot;sad_face&quot;,
35&quot;iconColor&quot;:&quot;red&quot;}</formatProperties>
36        <formatType>ICON</formatType>
37        <order>3</order>
38        <visibilityRule>
39            <criteria>
40                <leftValue>{!Record.Customer_Sentiment__c}</leftValue>
41                <operator>EQUAL</operator>
42                <rightValue>Unhappy</rightValue>
43            </criteria>
44        </visibilityRule>
45    </uiFormatSpecifications>
46</UiFormatSpecificationSet>

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

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>Sentiment_Score</members>
5        <name>UiFormatSpecificationSet</name>
6    </types>
7    <version>62.0</version>
8</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.