How do I update the Route segment on page load?

I have a “segment”, or query param, called “step” that I want to set with a dynamic value on load of that page, but I’m not sure how to do it. Currently I’m getting a 404 error, but if I manually add a number like below then the page loads. So, how do I dynamically get a value and update the Step on page load?

/get-started/1

image

Community Page
Last updated: