Newer Version Available

This content describes an older version of this product. View Latest

Get Flow Variable Values to a Visualforce Page

Flow variable values can be displayed in a Visualforce page. Once you’ve embedded your flow in a Visualforce page, you can use Visualforce markup to get values for variables or record variables. To display values for a collection variable or a record collection variable, you can use Visualforce markup to get the individual values contained in the collection.

You can get only variables that allow output access. If you reference a variable that doesn’t allow output access, attempts to get the variable are ignored. Compilation can fail for the Visualforce page, its <apex:page> component, or the Apex class.

Note

The following example uses an Apex class to get a record variable value from a flow and then displays it in a Visualforce page.
This example uses an Apex class to get the values that are stored in a string collection variable (emailsCollVar) in the flow. Then it uses a Visualforce page to run the flow interview. The Visualforce page iterates over the flow’s collection variable and displays the values for each item in the collection.

The following example uses an Apex class to set the flow to {!myflow} and then uses a Visualforce page to run the flow interview. The Visualforce page uses a data table to iterate over the flow’s record collection variable and display the values for each item in the collection.

Depending on the contents of the record collection variable in your flow, here’s what that data table looks like.Example of a data table that displays the contents of a record collection variable