15

I need to pass an ID as an input parameter to a visual workflow.

I could not find any documentation on how to do it.

Is it possible?

2 Answers 2

14

The short answer is Yes, absolutely. You can pass variables using the standard HTTP URL parameters. So from the lead page you can have a link to launch a flow and pass the leadID as the following nax.salesforce.com/flow/myLeadFlow?vaLeadID={!ID}

where vaLeadID is the unique name of the variable in flow.

If you are using a Visualforce Page with a flow embedded in it, you can pass the values using the tag in a VF page, something like this:

<apex:page>
  <flow:interview name="MyFlow">
    <apex:param name="var1" value="Value1"/>
  </flow:interview>
</apex:page>
1

I think Metadaddy has it correct but what has thrown me not to use for the longest time is that they never use it in a context that most people understand. Using the Lead Id example that Metadaddy gave reference to in the URL pass through while applying it as a apex:param you would write it like this:

<apex:page> <flow:interview name="MyFlow"> <apex:param name="vaLeadID" value="{!ID}" /> </flow:interview> </apex:page>

this will accomplish the same thing as the URL pass through. The only issue that comes with this is it has to be a button or link on the Master/Parent of the object that you are trying to create not within a button on the related list.

1
  • I hope metadaddy has it right because he's been a lead developer at Salesforce for a bit. His example is in the Flow docs. There are a couple others also.
    – ddeve
    Jun 20, 2014 at 22:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .