There are numerous scenarios in which you might need to obtain the current URL for various purposes. For example, you may wish to extract parameters from it, pass record id to a flow in the utility bar, or perform an analysis. However, there is no standard way to get the URL.
In this post, you can find a Lightning component that gets the URL. You can call it as a local action from screen flows in order to obtain the URL. Then you can parse the obtained value within the flow and extract any necessary information.
How to Use the Component
1- Install the component using the installation links below.
2- Add a new action to your flow and search for GetURL, this is the name of the component that you installed.
You can use the component's output value in order to obtain the current URL.
While it is currently possible to pass parameters to screen flows, dynamically passing values to screen flows on Lightning pages is not supported. However, you can accomplish this by utilizing this action. For instance, as you can see here, screen element displays the current URL and the parameter that we passed (Name__c).
Pay attention that after getting the output value from this action, you should use formulas to extract the parameters. It doesn't extract the parameters automatically.
Read this post to see how to use this action in order to pass the record Id to a flow in the utility bar.
Use this link to install in production or developer edition environments.
Use this link to install in sandbox environments.