My recent post on bypassing validation rules (WHAT CONDITION YOUR VALIDATION IS IN) generated a record number of comments. It is all kinds of awesome to know that folks are reading the blog AND asking questions.
Two comments in particular were around pushing the userID over to the flow. After much facepalming, I realized that I never really explained how to do that.
There are actually a couple of ways of pushing data to a flow, however, I am going to share with you all my absolute favorite ways of doing this that you can also apply to all sort of other situations. In true “SFDCinSEA” fashion we are going to take the well documented idea of a pushing data in a URL (Best write up EVER!) , applying that notion to flows (From the Source!) and throwing in a bit of a curve ball by doing all this from a formula field (Evil laugh goes here!).
To do this, you will need the following:
- A flow
- A flow variable for the running user (varUserId)…What was actually asked about in the comments
- A flow variable for the accountid (VarPassedAccountID)…Just because I can
- A Hyperlink field
The basic premise is that we are going to use the hyperlink to launch the flow. When the user clicks on the hyperlink, it will pass over the accountID and running UserId.
Enough build up…here is what it looks like:
“Hyperlink(“/flow/validation_rule?varUserID=”&$User.Id&”&varPassedAccountID=”&Id,”Validation Rule Update”)”

Sorry, you will need to click on it to see it in all of its weird font glory
Hmmm, that was really anticlimatic..wish there was a way to kick that up a notch, but there really isn’t…this is just a good use of the tools salesforce gives us!
Here it is sitting there looking awesome on the layout.

just want to smoosh it’s cute little URL
And here is proof that the values are passing!

MOAR BLURRING!
And yes, yes I am passing two values over to the flow.
You can even use similar type of functionality if you decide to use a button.
One of the reasons I like doing this in a hyperlink field though is that I can change dynamically how this field is presented. For instance, I could use an image field to change how this looks based on some criteria. I could even “mask” the data by looking at the running user. Heck, I could even change which flow is actually running!
Enjoy, and keep the dialogue going!
Thanks Andrew! Any ideas how to do this in a Flow Trigger?
Hey Erica,
Launching a flow from a trigger requires a workflow, which can only be launched from a “save” action. Unfortunately, you can’t set the order of operation for workflows, so this would be a sketchy operation at best.
But, since this is just an assessment based on a blog post, there might be other options. Feel free to send me a message on success.salesforce.com!
https://success.salesforce.com/_ui/core/userprofile/UserProfilePage?u=00530000001sGiLAAU&tab=sfdc.ProfilePlatformFeed
andrew