Insert and Redirect to Profile Page

I have a client details insert form that works wonderfully. What I want to do though is on success to redirect to the client profile page. I have tried following the steps in this video that @Hyperbytes has provided.

Problem is I am using routing. How would I set up the redirect using routing?

Hi @brad
What’s the issue you are having with the redirect and what are you trying to do exactly - can you provide an example?

Well just use your routing urls for redirects.

Well, I am using routes and as George suggests, just pick it using the routes picker. My problem is passing the parameter value to get it to select the proper record on the detail page.

So when I do my browser goto and select the route to go to the redirect page, how do I assign this value?

This is what I have for me browser redirect

browser1.goto('clientprofile/{{formAddUSer.data.clientkey}}/'

To me this makes sense and should work. However it doesn’t redirect at all. I get the following error in the dev console.

Is this a bug perhaps? Redirect works fine to a page without a parameter.

Brad, your expression seems wrong.
Try using:

browser1.goto('clientprofile/'+formAddUSer.data.clientkey)

As it’s explained in the docs, only the static parts of the URL is wrapped in single quotes. The dynamic part does not need {{}}

Much closer … at least it goes to the correct page now. URL is missing the trailing / and comes up with a 404 error. Where would I add that?

Also, so this is a bug then as I used the GUI to generate my redirect?

If you need the trailing / then just use:

browser1.goto('clientprofile/'+formAddUSer.data.clientkey+'/')

Not sure what the UI has to do with this, the docs explain pretty well how to do this.

1 Like

The docs don’t explain how to do this using routing. It’s all working now anyways. Thank you once again for the fantastic support.

Brad, it does not matter if it’s routing or not. Dynamic part is always dynamic part, static part is always static part :slight_smile:
Glad you have this working.

2 Likes

This was really helpful…though if you create the routing using the properties section of the App Structure it generates the code incorrectly.

If I set up a browser .goto action, choose the URL route and select the parameter from there the code it generates is:
browser1.goto(’/settings/editstaff/{{id}}/’) which doesn’t work.

Based on this thread it should generate:
browser1.goto(’/settings/editstaff/’+id+’/’)

If I type this into the code editor it works just fine.

The docs may well explain how to do it (though this was the only place I’ve managed to find it!) but it does look like there may be a bug in the code generated by the UI here?

1 Like