Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • John Oxenbridge 3 posts 74 karma points
    Jul 19, 2018 @ 09:49
    John Oxenbridge
    0

    Deployment of Umbraco Form Definitions across environments

    Hi,

    Hopefully someone will be able to provide advice on the following:

    Our Aim

    To be able to build forms within our development environment and deploy these through our test and then production environments. On submission of a form, the customer should be redirected to a form-specific page.

    Environments

    Our test and production environments split the Umbraco FrontEnd from the BackOffice so the FrontEnd can scale. We use Azure auto-scaling. We are on Forms version 7.0.3.

    Problem

    We can build forms in our development environment, include the form and workflow JSON definition files in our source repository, and deploy through the environments without a problem. The problem we have hit is that rather than use the inbuilt "Thank you" message, we want to redirect customers to a form-specific page after submission.

    When defining the form, you are able to pick the page (the nodeID) that the form should redirect to after submission as part of the default workflow. This is stored in the JSON definition file. When moving between environments, the nodeIDs won't match so we get an error. Yes, we can update the form definition in the production BackOffice to use the correct page but this means:

    1. This would need updating for every form after every site deployment which isn't viable, and,
    2. The workflow JSON files updated on the BackOffice instance won't be on the Frontend instances.

    Has anyone come across an approach for dealing with this? We're scratching our heads...

    Many thanks.

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Jul 25, 2018 @ 18:59
    Marc Goodson
    0

    Hi John

    In Contour you had the ability to set a value for XPathOnSubmit to specify the XPath to redirect to after form submission to avoid this problem.

    The XPathOnSubmit option is still visible in the workflow json definition file on disk, but whether it's functionality has been ported across to Umbraco Forms - worth a try? setting it in the Json file?

    Although I've just found this: http://issues.umbraco.org/issue/CON-1275

    So feels like it's probably not going to work :-(

    I suppose you could do something hacky in /views/partials/forms/form.cshtml

    If (Model.SubmitHandled){ //redirect based on a value in Model.MessageOnSubmit }

    I think the formstate is stored in TempData["umbracoformsform"] You might be able to access that if you hijack the route the form is on... and intercept.

    Hmm

    regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft