---
schema_version: "1"
id: 7fb214b00963b87f7e97e5d712d6f5c12a016a5e90d186b6faa20ce9604e735e
title: Customize a Flow URL to Control Finish Behavior
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_distribute_internal_url_returl.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_distribute_internal_url_returl.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a59806638278741325d46fc6c34fe9ea1cdd7e4d53db9bdc8f4cf68e4c4513eb
description: By default, after a user finishes a screen flow, the screen flow redirects the user to the first screen. If you want to redirect users to another page within Salesforce when they click Finish, use the retURL parameter in the flow URL.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Customize a Flow URL to Control Finish Behavior

By default, after a user finishes a screen flow, the screen flow redirects the user to the first screen. If you want to redirect users to another page within Salesforce when they click **Finish**, use the retURL parameter in the flow URL.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

## Format

To redirect users in a screen flow to a specific page in Salesforce after they click **Finish**, use this format.

```
/lightning/flow/flowName?retURL=url
```

The url is a relative URL (the part of the URL that comes after https://MyDomainName.my.salesforce.com/ or https://MyDomainName.lightning.force.com/).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note We recommend using Lightning experience and adding /lightning to the beginning of your flow URL. However, if you don't add /lightning to the flow URL, it still works, but you don't get the new benefits of running in Lightning. To learn more, see [Choosing Between Lightning and Non-Lightning Flow URL Formats](https://help.salesforce.com/s/articleView?id=platform.flow_distribute_internal_url_lightning_vs_lightning_out.htm&release=264.0.0&type=5 "When you run a screen flow from a URL, you can choose between using Lightning or the non-Lightning URL format, which uses Lightning Out. We recommend using Lightning for a faster, more consistent experience. However, there are times when you need to use the non-Lightning format.").

For example:

1. Create or identify the screen flow that you want to customize.
2. Determine the destination URL where you want the flow to redirect users to after they click **Finish** on the final screen.
3. Append `?retURL=url` to the flow URL, where url is the relative URL of the destination page.
4. If you're also passing input variables to the flow, add the retURL parameter after the variable parameters, separated by `&`. For example: `/lightning/flow/MyFlow?flow__varCaseId=500xx000000abc&retURL=lightning/page/home`.
5. Use the complete URL with the retURL parameter in your button, link, or component.

## URL Options

Redirect flow users to these Salesforce URLs.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122956e167">Redirect Destination</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122956e170">Relative URL</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122956e173">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Redirect Destination" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e167 ">Chatter</td>

            <td data-label="Relative URL" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e170 ">_lighnting/page/chatter/</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e173 ">lightning/page/chatter/ui/ChatterPage</td>

          </tr>
          <tr class="">
            <td data-label="Redirect Destination" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e167 ">Home page</td>

            <td data-label="Relative URL" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e170 ">lightning/page/home</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e173 ">lightning/page/home</td>

          </tr>
          <tr class="">
            <td data-label="Redirect Destination" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e167 ">List view</td>

            <td data-label="Relative URL" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e170 ">
              <p>Lighting Experience:
              </p>
              <p>o/<var>object_name</var>/list?filterName=<var>API_name</var></p>
              <p>Pinned
                list view:
                lightning/o/object_name/list</p>
              <p>Classic:</p>
              <p style="margin-bottom:0;"><var>objectCode</var>?fcf=<var>listViewId</var>
              </p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e173 ">
              <p style="margin-bottom:0;">Lightning Experience: lightning/o/Case/list?filterName=MyCases</p>
              <p style="margin-bottom:0;">Classic:
                006?fcf=00BD0000005lwec</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Redirect Destination" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e167 ">Object home page, such as Accounts home</td>

            <td data-label="Relative URL" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e170 "><var>objectCode</var>/o</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e173 ">001/o</td>

          </tr>
          <tr class="">
            <td data-label="Redirect Destination" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e167 ">Specific record, such as a contact, report, dashboard, user, profile, or
              Chatter post</td>

            <td data-label="Relative URL" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e170 "><var>recordId</var></td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e173 ">0D5B000000SKZ7V</td>

          </tr>
          <tr class="">
            <td data-label="Redirect Destination" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e167 ">Visualforce page</td>

            <td data-label="Relative URL" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e170 ">apex/<var>pageName</var></td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e173 ">apex/myVisualforcePage</td>

          </tr>
          <tr class="">
            <td data-label="Redirect Destination" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e167 ">Web tab</td>

            <td data-label="Relative URL" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e170 ">servlet/servlet.Integration?lid=<var>webTabId</var></td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d122956e173 ">servlet/servlet.Integration?lid=01rD0000000A88h</td>

          </tr>
        </tbody>
      </table>

- Object codes are three-digit prefixes that identify standard and custom objects in Salesforce. Look at the object's record ID prefix in the URL or in the object's details. For example, Account objects use the prefix `001`, Case objects use `500`, and Opportunity objects use `006`. Alternatively, create a test record of the object type and examine the first three characters of the record ID. The object code matches those three characters.
- For Salesforce Classic URLs, Salesforce redirects your users to the right page in whichever Salesforce experience they’ve enabled—Lightning Experience or Salesforce Classic. If the page doesn’t exist in Lightning Experience, Salesforce redirects the user to the page in Salesforce Classic.
- For Lightning Experience URLs, Salesforce always redirects your users to the home page in Lightning Experience (`lightning/page/home`), even if the user has Salesforce Classic enabled. Users who don’t have permission to access Lightning Experience see an error message.
- Web tabs in Lightning Experience can redirect only to Visualforce pages.
- When you pass a record ID in the URL, for example, `flow__varCaseId=500xx000000abc`, the behavior depends on the flow variable type in your flow:
    - For a text variable, Salesforce passes the record ID as a text string. The flow receives the ID value, for example, `500xx000000abc`.
    - For a record variable, Salesforce attempts to pass the entire record object. However, passing a record ID in the URL doesn't automatically load the full record. The flow receives the ID, but use a Get Records element in your flow to retrieve the full record data based on that ID.
    - For a record variable that passes only an ID, the flow may fail if it expects record fields that aren't provided. Always use a Get Records element after receiving a record ID to populate the record variable with the necessary fields.

## Limitations

- You can’t redirect flow users to a URL that’s external to your Salesforce org.
- You can’t use a flow variable as the value for the retURL parameter. To use a flow variable to redirect a user, such as to a specific record, distribute the flow using Visualforce.
- retURL can cause nested top and side navigation bars to render on the destination page.
- If you don’t add `/lightning` to the beginning of the flow URL, retURL is case-sensitive. If you use retUrl, the URL doesn’t redirect the user.
- Action Button screen components don’t support the retURL parameter.

## Examples

Before you customize the button URL on the Case object, the button launches a flow. When users finish the flow, they're redirected back to the flow's first screen.

```
/lightning/flow/Case_Update_Flow
```

You then customize the button URL to redirect users to the Case list view after they finish the flow.

```
/lightning/flow/Case_Update_Flow?retURL=500/o
```

To customize the button:

1. In Setup, click **Object Manager**.
2. Click **Case**, and then click **Buttons, Links, and Actions**.
3. Find your custom button, and click **Edit**.
4. In the URL field, add ?retURL=500/o to the end of the flow URL.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)
    
    Note
    
    The `500` is the object code for Case.
5. Click **Save**.

This flow URL redirects users to Accounts home, which exists in both Lightning Experience and Salesforce Classic.

```
/lightning/flow/myFlow?retURL=001/o 
```

When Lightning Experience users finish the flow interview, Salesforce redirects them to `http://MyDomainName.lightning.force.com/lightning/o/Account/home`. When Salesforce Classic users finish the flow interview, Salesforce redirects them to `http://MyDomainName.my.salesforce.com/001/o`. Either way, Salesforce redirects users to Accounts home in their respective experience.

This flow URL redirects users to a Visualforce page that exists only in Salesforce Classic.

```
/flow/myFlow?retURL=apex/myPage
```

When users finish the flow interview, Salesforce redirects them to `http://MyDomainName.my.salesforce.com/apex/myPage` in Salesforce Classic. When they navigate away from the Visualforce page, Salesforce reverts to their original experience.

For instance, after viewing the Visualforce page, users go to the home page. For Lightning Experience users, Salesforce renders the Lightning Experience home page (http://MyDomainName.lightning.force.com/lightning). For Salesforce Classic users, Salesforce renders the Salesforce Classic home page (`http://MyDomainName.my.salesforce.com/home/home.jsp`).

This flow URL sets the varUserFirst and varUserLast variables (both of type Text) to the running user’s FirstName and LastName field values. When the flow interview finishes, it redirects the user to the home page for the enabled Salesforce experience.

```
/lightning/flow/User_Info?flow__varUserFirst={!$User.FirstName}
   &flow__varUserLast={!$User.LastName}&retURL=home/home.jsp
```

#### See Also

- [Distribute a Flow](https://help.salesforce.com/s/articleView?id=platform.flow_distribute.htm&release=264.0.0&type=5 "After you’ve designed and tested your flow, it’s time to put it to work! Flows can be run in several ways, depending on who the flow is designed for. Internal users, external users, or systems can run a flow, or a flow can be deployed for another organization.")
- [Troubleshooting Flow URLs](https://help.salesforce.com/s/articleView?id=platform.flow_troubleshoot_url.htm&release=264.0.0&type=5 "If you’re distributing a flow and the custom button, custom link, or a direct flow URL isn’t working as expected, verify the referenced flow. In addition, verify its variables if you’re passing values into a flow from the URL.")
- [Send Variable Values to a Flow Using the Flow's URL](https://help.salesforce.com/s/articleView?id=platform.flow_distribute_internal_url_variable.htm&release=264.0.0&type=5 "When you distribute a flow by using a URL, you can set variables values within that flow by using parameters in the URL.")