Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Access Apex-Defined Variables from Outside Flows
Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.
Why: The Apex-defined data type lets you represent complex data that doesn’t fit well in Salesforce objects. For example, you can set up External Services to access external web objects. To work with those web objects in flows, set up flow variables that use the Apex-defined data type.
When used with Subflow elements, you can better organize and manage your Flow implementations. Suppose you have a complex, multi-step business process that revolves around an Apex-defined data type. Now you can use a master flow that passes complex data among other flows when running them via Subflow elements. This implementation lets you improve specific steps in the process without affecting other steps in the process.
How: Configure each Apex-defined variable that you want to access from outside the flow as available for input, output, or both. This example shows an Apex-defined variable named “Cart_Item” that is available for input and output.
Then you can access the Apex-defined variable from outside the flow. This example shows how a Subflow element in another flow can set the value of the “Cart_Item” Apex-defined variable.