I'm trying to retrieve the record Id and pass to my the Flow I have included in Lightning Experience but I'm getting some issues. I have already posted the question in Salesforce forums, but with no luck. Any idea here?

  • Would you not have to do a lookup to retrieve the object first? – Phil Hawthorn Dec 2 '16 at 18:21
  • how is the flow invoked? from a Process builder flow? From Apex? From a VF page? More info is needed here – cropredy Dec 3 '16 at 1:27
  • @PhilHawthorn yes, I also used a lookup to retrieve the object. My issue was the way to retrieve the id from the url and use it in the lookup. – Agustina García Dec 4 '16 at 19:08
  • @cropredy, I added the flow in a record page in LEX. As I said above, below answer is the solution. Thanks! – Agustina García Dec 4 '16 at 19:09

Create a new variable in your flow, with entry permission, not private, and call this {!recordId}

Before you try it, must to remove component flow from your page layout > save > put again flow component in page layout and try it

If you create the recordId variable after put the flow component in the page layout, doesn't work, maybe something wrong with Browser Cache.


If you have any issue, comment this.

Good luck!!

  • Thanks!! No way to guess that {!recordId} would return to me the record Id from the url. – Agustina García Dec 4 '16 at 19:10
  • You're welcome. For future occasions, such as creating another VisualFlow and forgetting to create the {!recordId} variable, remember that after creating it, remove and re-put the VisualFlow in the Lightning Page (Edit Page, not Format Layout). – Raspi Dec 4 '16 at 19:20
  • Yes, thanks. I will. Actually I created several variables (not sure if you checked my post in forums) but didn't chose the right name for the variable. I was thinking ... from where this "recordId" comes from? I mean, no reference in the documentation as far as I found. But it is the same as in Lightning Component if you implement hasRecordId interface and the attribute is recordId. I will try to remember. Thanks again. – Agustina García Dec 5 '16 at 6:54
  • 1
    recordId variable is a reserved variable. Embed a Flow in a Lightning Page (BETA) Documentation – Raspi Dec 5 '16 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.