AnimationRule defines the criteria for displaying an animation to Salesforce Path users. It combines activation, object and record-type scope, qualifying picklist selections, and display frequency. It controls Path animation behavior, not the Path definition itself.
Key Elements
| Element | What the Element Controls |
|---|---|
animationFrequency |
Required. Controls how often a qualifying selection displays an animation. Documented values are always, often, sometimes, and rarely. |
isActive |
Required. Activates the rule when true; makes it inactive when false. |
sobjectType |
Identifies the object on which the rule runs. The field and record type must be interpreted in this object's context. |
recordTypeContext |
Required. Sets applicability to All record types, the Master record type, or a selected Custom record type. |
recordTypeName |
Identifies the selected record type. Interpret it together with recordTypeContext, not as an independent definition of scope. |
targetField |
Required. Names the field whose picklist selections determine whether the rule qualifies. |
targetFieldChangeToValues |
Required. A single string containing the qualifying values. Salesforce's example represents multiple values as a comma-separated string. |
developerName |
Required. The developer name of the rule. Viewing, grouping, sorting, and filtering this field is permission-restricted. |
Behavior and Constraints
An animation depends on the settings working together: the rule must be active, the record must fall within its object and record-type scope, and the user must select a value in targetField that matches a value in targetFieldChangeToValues. The rule's frequency then determines whether the animation appears for that qualifying selection.
always displays the animation every time a qualifying selection occurs. often, sometimes, and rarely display it progressively less frequently. A missing animation on one qualifying selection is therefore not necessarily a configuration failure. No numeric probabilities are documented for these choices.
Resolve targetField and recordTypeName against sobjectType. The rule is not limited to custom objects or custom fields: Salesforce's example uses Opportunity and StageName. Changes to the configured picklist values matter because qualification depends on matching the values stored in targetFieldChangeToValues.
Only users with View DeveloperName or View Setup and Configuration permission can view, group, sort, and filter developerName. This restriction concerns access to that field; it is not a stated permission requirement for seeing Path animations.
Deployment and Retrieval
AnimationRule components are stored in the animationRules folder with the .animationRule suffix. In package.xml, use AnimationRule as the metadata type name. The manifest supports either named members or the * wildcard.
The type extends Metadata and inherits fullName. It also requires its own developerName element. The required masterLabel element supplies the rule's label; it does not replace either name field.
Represent targetFieldChangeToValues as one string, not repeated XML elements. For example, Salesforce shows Delivered, Negotiating, Closed Won inside a single targetFieldChangeToValues element. That example demonstrates comma-separated values, not a requirement to use those particular values.
Salesforce's sample manifest includes the PathAssistant member of Settings alongside an AnimationRule member. This is a sample manifest, not a stated requirement to include that settings member in every deployment or a prescribed deployment order.
To stop the rule's animation behavior without removing the component, set isActive to false.
Relationships
The rule's references form an object-scoped configuration. sobjectType establishes the object context for the triggering field and selected record type. The metadata type names CustomObject and CustomField do not restrict these references to custom objects or fields.
References
-
CustomObject:sobjectType. -
CustomField:targetField. -
RecordType:recordTypeName.
Documentation Inconsistencies
The documented allowed values for animationFrequency are lowercase, but Salesforce's XML example uses Always. The example does not establish that capitalization is interchangeable. Use the documented lowercase values rather than assuming the example proves that both forms are accepted.
Reported Issues
-
Direct Apex SOQL access was reported unavailable. A 2021 community inventory of API objects listed
AnimationRuleas absent from the ApexSchemanamespace and not queryable directly in Apex. This report concerns Apex query access, not Metadata API deployment or retrieval. See the Apex queryability discussion.
Common Questions
Why does my Path animation not appear every time?
Check isActive, object and record-type scope, and whether the selected value matches targetFieldChangeToValues. Even when those conditions match, frequencies below always intentionally display the animation less often.
How do I retrieve AnimationRule metadata?
Include AnimationRule in package.xml with named members or *. Its components use the .animationRule suffix in the animationRules folder.
Can AnimationRule use standard objects and fields?
Yes. Salesforce's example uses Opportunity with StageName. The relationships to CustomObject and CustomField do not impose a custom-only restriction.
How do I configure multiple values to trigger an animation?
Use one targetFieldChangeToValues string. Salesforce's example puts multiple qualifying values in that string, separated by commas; it does not repeat the element.
Do users need View DeveloperName to see Path animations?
The documented permission restriction applies to viewing, grouping, sorting, and filtering developerName. It should not be treated as a permission requirement for seeing the animation itself.