Skip to content

SubmitAndRedirect

Harry Woodall edited this page Jul 25, 2022 · 1 revision

Submit and Redirect

This behavior will replace the default functionality of returning a success page after successful submission, and instead will redirect to the url supplied.

Required Fields

  • conditions: List
  • behaviourType: "SubmitAndRedirect"
  • SubmitSlugs: List (The SubmitSlug will vary according to the environment)

SubmitSlug

  • Environment: string
  • URL: string
  • AuthToken: string
  • redirectUrl: string

The redirect url supports tag parsing and can take values of previous questions.

"RedirectURL": "https://www.redirect.com?parameter={{questionId}}"

The redirect url will be supplied with a 'reference' parameter which will be given the return value passed back by the service.

https://www.redirect.com

Becomes

https://www.redirect.com?reference=01234567890

Example

"Behaviours": [
        {
          "conditions": [],
          "behaviourType": "SubmitAndRedirect",
          "SubmitSlugs": [
            {
              "Environment": "local",
              "URL": "https://localhost/api/v1/Home/Post",
              "AuthToken": "local-authtoken",
              "RedirectURL": "http://exampleRedirectUrl.com"
            },
            {
              "Environment": "Int",
              "URL": "http://int/formbuilderservice/api/v1/Home/Post",
              "AuthToken": "int-authtoken",
              "RedirectURL": "http://exampleRedirectUrl.com"
            },
            {
              "Environment": "QA",
              "URL": "http://qa/formbuilderservice/api/v1/Home/Post",
              "AuthToken": "qa-authtoken",
              "RedirectURL": "http://exampleRedirectUrl.com"
            },
            {
              "Environment": "Stage",
              "URL": "http://staging/formbuilderservice/api/v1/Home/Post",
              "AuthToken": "staging-authtoken",
              "RedirectURL": "http://exampleRedirectUrl.com"
            },
            {
              "Environment": "Prod",
              "URL": "http://prod/formbuilderservice/api/v1/Home/Post",
              "AuthToken": "prod-authtoken",
              "RedirectURL": "http://exampleRedirectUrl.com"
            }
          ]
Clone this wiki locally