As of Spring ’17, we will have a much easier User Experience for anyone attempting their first Flow in a Lightning Page. You now are able to pick which variable you want to pass the Record ID into. Sounds great, right? Let’s dive right in!
Select the variable to pass the Record ID into
Now with the check of a box, you’re able to select which variable you want to pass the Record ID into. You can name it whatever you’d like now! Also, you can pass in a static value into any of the variables, so that you’re able to tell where your Flow might have been used (since you can have a different Lightning Page for different Record Types or Apps.
What if you already setup a Flow when this was launched in Winter ’17? Don’t worry, Salesforce has you covered:
If you created a Text input variable called recordId for the flow component during Winter ’17, the checkbox is automatically selected when your org upgrades to Spring ’17. This default selection happens only when your org upgrades to Spring ’17. If you create a Text variable called recordId in Spring ’17 or later, the checkbox is not selected by default.
Things to consider
#1 – No Merge Fields (for now)
Many of you are probably thinking about passing in a merge field. You’ll need to hold off on that for the time being. My guess is it might come in the future, once this is Generally Available and out of BETA. But, for now, if you try and get clever and use something like {!Record.Name} or {!Account.Name} you’re going to have a bad time!
#2 – Keep your Inputs Clean
I touched this on my Flowception post (essentially, making your Flows reusable), but you’ll want to make sure that you only make the variables you need to an Input Type. If you have too many variables marked as Input or Input and Output, you’re going to have a long and cluttered list. Be thoughtful and only make a variable an Input if it needs to be.