Use Apex-Defined Data Type Collection Variables with Operators in Assignment and Decision Elements

Apex-defined data types let flows work with complex data objects, which are commonly required by web services. Assignment and Decision elements can now manipulate Apex-defined collection variables with the full set of operators. Previously, Apex-defined collection variables supported only the Equals operator, and non-collection Apex-defined variables supported all operators.

Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.

Why: For example, a flow uses an Apex-defined collection variable to store a list of car registrations from a system outside of Salesforce. Now you can use a Decision element to check whether a car registration already exists in the list of registrations from the external system.

A decision element screen shows a Yes outcome if {!CarInventory.registrations} contains {!carRegistration}.

If the registration isn’t already in the list of registrations, you can add it to the list using an Assignment element.

An assignment element screen shows  {!carRegistration} being added to the collection {!CarInventory.registrations}.