When creating an Umbraco form you set the base workflow to either display a message, or go to a page. I want to be able to redirect the user to a specific page based on something they’ve entered on the form.
For example, if I have a form with a drop down “Where did you hear about us?”, and the user selected “Google” then I want to send the user to “/google”, but if they select “Bing” then they should end up on “/bing”.
My first thought was that you could set conditions on the workflow, but that’s not an option. Guessing this is because it’s a fixed workflow on every form that has to run.
I’ve also found a setting redirectToPageId (as detailed in the docs) but this is dynamic based on where the form is rendered, rather than what the user completes on the form.
Can anyone shed any insight on how this might be acheived please?
The docs mention an additionalData parameter as well (alongside the redirectToPageId) - if you could get access to that on the redirected page, you might be able to suss it out, as it’s being processed for Magic strings, which means you could send along the info
There is a value on the HttpContext.Items you can modify in a custom workflow to provide a custom redirect Richard. It’s documented here, and could be you can use that for your use case.