Flow Components has two options for you to redirect your Flow, you can either redirect your Flow to a new record or you can redirect your Flow to a URL. There are two Actions available in Flow, Redirect Flow – Record Id and Redirect Flow – URL. When you drag an Action interaction into the canvas, you’ll be able to type in redirect to see your two options.

Both Actions are available as a “headless” Action or can be displayed in a Screen as a button. For record id, you can add the record id for any record, including newly created records from your Flow. Simply put in the record id of the record you want to redirect to in the Record Id part of the Set Input Values and when your Flow lands on the Redirect Flow – Record Id Flow Action, the Flow will redirect to that record.

To be able to redirect your Flow to a URL, you can use the Redirect Flow – URL Flow Action. You can simply add your URL to the Redirect URL input in the Set Input Values section. This includes redirecting your Flow to a Record or any URL, and using variables from within your Flow to add to the URL. An example of redirecting the Flow using a URL with a recordId variable from within the Flow is below.

Additionally, you can use the Redirect Flow – Record Id and Redirect Flow – URL as a button in a Screen.

After selecting the Action in the Flow Screen, you can then fill in the appropriate information, such as the Record Id or the URL. The Button Label will display to the User as the button.

The button will display as below.

27 comments

  1. Hi Rich. Thank you as always for this effort. I updated my package to get the new redirect to ID action, but I’m getting an error. I call the flow from a url list button in a related list on the case object. Debug shows it’s getting the created record’s ID, so it seems to be beyond that.

    Unable to find action ‘redirectRecord’ on the controller of ecflc:flowIdRedirect Failing descriptor: {ecflc:flowIdRedirect}

    1. I’m guessing this related to how a case is “special”. If I call the flow from an action it works fine. I want the button on the related list though. πŸ™

      1. Hi Ben,
        I don’t think it has to do with the case, but perhaps that it is on the related list. You say that you’re getting the created record Ids? What are you trying to redirect to? Are all of the ids in a single variable or are you filtering to a single record id?

      2. Yeah I do think it is it being in the related list. It’s like the flow is stuck in that iframe or whatever it is now and can’t get out.
        The new record is created for sure and I am trying to redirect to the new record page. I’m using the record id from the single record variable that I assign values to and then create.
        I have since moved the create part to a lightning tab/flow component which does work, so probably that related list bit like you said.

      3. I did release a patch last night if you want to update from the appExchange to 1.3.1 and try again, let me know if that works.

      4. I updated, but didn’t notice a difference still stuck in that frame. Everything works but that though. I’m going to blame salesforce. πŸ™‚

      5. I noticed for me it took a refresh or two of the page after the upgrade, didn’t work immediately. Try logging out and logging back in and trying one more time, if not, then something else must be going on…

    1. I had a feeling you were going to say that… Community navigation is a bit different unfortunately. At the moment, in communities, that’s the only way that it works.

    2. Hi Ben,

      If you redirect using a URL, you should be able to redirect to “/detail/”&{id} and it will open in the same page. Just tested and confirmed this functionality. Community navigation is a bit different, so this is the reason that you were opening to a new tab.

  2. Ha, no worries. Maybe I can finish inside a community page. Just somewhere where the flow won’t restart.

    1. Try the run flow button, there is a setting to be able to refresh the record when the flow finishes as well as reset the flow to a button, that might take care of it for you.

  3. Great idea, but I need to be able to pass in a component variable unfortunately. It’s a knowledge article Id for some legal stuff. That allows the page builder (generally marketing) to change that if needed. I could hard code it in the flow instead, but it’s just different than they’re used to.

  4. I’m also seeing this error even after creating an input/output (just in case) variable named recordId.

    The value null is being provided for variable recordId but isn’t compatible with the variable’s data type (String).

  5. Hi Ben,

    I have to create a list view button/quick action in lightning page which launches the flow to create a record and once created need to redirect to record detail.
    I have created a lightning button with floe url to launch the flow and using it on the list view as for some reason I could not get the lightning quick action show up in the Lightning list view.

    When I click on the lightning button on list it launches a flow and creates a record but failing to redirect. I am using lightning action(referencing the component to redirect to record) in flow and passing the record id in the flow but, still does not navigate to record detail when flow finishes. Can you please help in what could be the best approach to this ?

    1. Hi Sarah,

      In our new release (coming soon!) we should have the ability to redirect to a flow in lightning. The issue right now is that the flow is running in classic runtime, even with lightning “activated”, so the navigation doesn’t work since it started in classic. With the upcoming release, we have a way to have it launch to a lightning component (instead of launching directly into the Flow URL), which allows up the update. Stay tuned!

  6. Hello Rich, this is awesome, thank you. Is there a solution that allows for a redirect in the same browser window? User gets the pop-up blocker message on mobile (I think it is enabled by default on iOS).

      1. Sure Rich, thanks for the reply. The user is on an iPhone accessing a community public page that is running a flow on it. At the end of the flow, I would like to send them to a URL. When I use your component, it works well on desktop. On the iPhone, I get a pop-up blocked message (I think pop-ups are blocked by default). I was wondering if I could redirect in the same browser window.

      2. Hi Andy,

        If you redirect using a URL, you should be able to redirect to “/detail/”&{id} and it will open in the same page. Just tested and confirmed this functionality.

  7. I tried both the Record and URL Redirect Actions: No error messages, but not redirection occurs. I used variables and hardcoded values for testing. Any clue what I’m doing wrong?

    1. Hi Mo,

      How are you launching the flow, via a URL? If so, please try using a quick action type of Flow instead with recordId as the input variable for the record. The URL button still runs without lightning navigation service, so the redirect doesn’t work when using the older URL calling the flow through a button.

      Rich

  8. Hi

    I’ve set this up in my Flow as a core action (Redirect Flow – Record Id), using the variable {!recordId}, but it just takes me back to the original record and not the newly-created record.

    I’m new to Flows and to variables, so I’m not sure what I need to do to have the new record open?

    Thanks in advance

    Karen

    1. Hi Karen,

      The {!recordId} variable is the id of the record that started the Flow, which is why it is redirecting you to the original record. In the Flow, when you make your update, there should be an Id that is assigned to the new record. If you use that variable, perhaps if you named it contact it could be something like {!contact.Id}, then it should redirect you to the id of that new record instead of the original one. I hope that helps!

      Rich

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: