function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Clive BearmanClive Bearman 

Passing variables into flows

Is it possible to pass lead ID and context into the flow as it starts, like passing command line parameters?

Best Answer chosen by Admin (Salesforce Developers) 
RajaramRajaram

Yes.. Absolutely.

You can pass variables using the standard HTM 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.

 

Hope this helps..

 

All Answers

RajaramRajaram

Yes.. Absolutely.

You can pass variables using the standard HTM 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.

 

Hope this helps..

 

This was selected as the best answer
studzeystudzey

Hi there, 

 

Is there perhaps a website to show me how to do this? I would appreciate it!

 

Regards,

 

StadlerQuote

 

osibtysosibtys

It would be good if this thread was labeled more extensively so it would show up in searches for things like "Visual Workflow URL Parameters" and "How to pass values to Visual Workflow" and "SalesForce Flow URL Parameter".  Hopefully this Reply will help other people find the thread :)

fresher@salesfresher@sales

where we should add this

 

nax.salesforce.com/flow/myLeadFlow?vaLeadID={!ID}

JaredPHJaredPH

For example on a button that is on a record detail page, where you want to pass the id of the current record into the flow. When you create the custom button, select URL as the content and add the URL. (Be sure to add the button to the page layout, too).

Jeff JobsJeff Jobs

Hi,

 

Does this work with TODAY() ?

 

I'd like to pass today's date into the variable varTODAY.  I used: [understood that nax should be replaced with my org number]

 

https://nax.salesforce.com/flow/nameofmyflow?varTODAY=TODAY()

 

and it did not work.  I did not use {!TODAY()} as I know that denotes a field.  Please advise.

Jeff JobsJeff Jobs
It did launch my FLOW though :)
Jeff JobsJeff Jobs

Just figured this out.  No one here has mentioned that you also need to make sure the variable in FLOW has an Input/Output type of "Input Only" so that it can actually receive URL variable information.  Still can't get TODAY() to work becuase of a data type error (even though my FLOW variable is a Date type).  Getting closer...

fresher@salesfresher@sales
If you need today date in flow...i believe the system.current date option is available in the flow. So you do not need to pass the today date in url. Use the flow system.current date.
goravsethgoravseth
Here is a link to another thread that details using TODAY in flows w the system.current data

http://boards.developerforce.com/t5/Visual-Workflow/Pass-today-s-date-into-a-variable-in-a-FLOW/td-p/583493
Amanda Byrne- Carolina Tiger RescueAmanda Byrne- Carolina Tiger Rescue
This looks exactly like what I need to do, but I'm still confused- when I'm creating my flow, how do I set it up to collect the id from the record where the button will be?  If I try to create a formula in the flow to call the Id, the flow throws an error when I try to save it. And how would I test it in the flow designer?  Somehow I've got to get a 'sample' Id to run the flow!
Roger WickiRoger Wicki
Is it possible to pass a value to the flow apart from URL parameters? Because my flow will be called by a process and will be an automated flow with no user interaction...
Paulo Perez 17Paulo Perez 17
How can I pass variable using process builder?