URL Routing
This documentation will primarily be focused on Anvil’s Routing dependency.
Using this dependency is not the only way to implement routing in an Anvil app, but we recommend using it above all other solutions.
Routing enables URL-based navigation in your app. Instead of the entirety of your app being bound to a single URL, every page and state of your app can be given a URL address.
This allows things like using the browser’s back and forward buttons, or bookmarking specific pages of your app.
Feature overview
Among several others, Routing offers the following features:
-
URL navigation through routes: By setting up Route objects with a Form and a URL path, the Routing dependency can take care of opening Forms based on which URL is currently being navigated to.
-
Caching: Routes can be configured to perform Form caching and/or data caching, storing Forms or data for later use instead of repeating the instantiation process every time a Form needs to be opened.
-
URL parametrization: Parameters can be embedded in a URL and passed to the Form. This allows access to specific Form states directly through URL history or bookmarks.
Installation
The Routing dependency can be installed through Anvil’s dependency framework.
Routing’s app token is:
3PIDO5P3H4VPEMPL
This code must be pasted into the third-party dependencies section of your app. In your app, go into settings, then dependencies, click on third party and paste in the dependency code. You will need to migrate your app to make use of layouts.

Pasting routing’s dependency app ID into an app’s third party dependencies.
The Routing app can also be cloned, allowing you to use it as an app of your own.
Alternatively, you can clone the Routing app directly from its GitHub repository. This will let you use the clone of Routing from your own apps as your dependency. After cloning the Routing app, in your other app, go into settings, then dependencies, and select the Routing app out of the dependencies dropdown. You will need to migrate your app to make use of layouts.

Adding a cloned version of the Routing app as a dependency of another app.
You can find the full in-depth technical documentation for the Routing dependency here.
Do you still have questions?
Our Community Forum is full of helpful information and Anvil experts.