Base JSON Structure - smbc-digital/form-builder GitHub Wiki

Base JSON Structure

    {
        "FormName": "",
        "BaseURL": "",
        "StartPageUrl": "",
        "FirstPageSlug": "",
        "Embeddable": true,
        "FeedbackForm": "https://stockportcouncil.typeform.com/to/yzIJEe",
        "FeedbackPhase": "alpha",
        "FormAccessKey": "AUniqueKey",
        "FormAccessKeyName": "QueryStringParameterName",
        "FormAccessReferrers": [ "https://www.example-url.com" ],
        "EnvironmentAvailabilities": [],
        "DocumentDownload": true,
        "GenerateReferenceNumber": true,
        "GeneratedReferenceNumberMapping": "CaseReference",
        "SavePaymentAmount": true,
        "PaymentAmountTargetMapping": "PaymentAmount"
        "ReferencePrefix": "TEST-",
        "ProcessPaymentCallbackResponse": true,
        "CallbackFailureContactNumber": "0161 217 6017",
        "DocumentType": [],
        "BreadCrumbs": [],
        "FormActions": [],
        "Pages": [],
    }

FormName

The name of the form this will display in the browser tab/window title#

BaseURL

The path of this form, this will come after the domain e.g. test-form would create forms.yourdomain.gov.uk/test-form/

StartPageUrl

The IAG start page for the form

FirstPageSlug

The first PageSlug the users will visit

Embeddable

Setting Embeddable to true will remove the header and footer from the form along with some other minor styling changes. It is set to false as standard, so is only required if being set to true. These forms can be used in iag-webapp by using the {{FORM:url of form}} tag parser within Contentful

FeedbackForm/FeedbackPhase

FeedbackForm if present will be used at the top of the form to link users to, a feedback to capture feedback on the new form, if present the FeedbackPhase is also required, this will be used to communicate to the user this form is still in a testing phase(usually "alpha" or "beta")

FormAccessKey/FormAccessKeyName

Basic protection can be added to forms to prevent them from being accidentally discovered or completed. This feature could be used to enable forms for a limited specific audience. Both a key and a key name must be provided to enable this feature.

FormAccessKey the secret that needs to be provided in order for the form to be accessible FormAccessKeyName the query string value the form builder should look at in order to find the key

FormAccessReferrers

Basic protection can be added to to enable a form to be only available when specific referrers are passed in the request referrer header.

FormAccessReferrers An array of allowed referrer urls

EnvironmentAvailabilities

Add basic availability to the form, by default forms are enabled, when developing forms it is recommended to disable the form within stage and production.

How to add Availability

DocumentDownload/DocumentType

Add a downloadable document to the success page.

How to add document download

Reference Numbers

Specify that the form should attempt to create a unique reference number and add this to the list of answers submitted. If reference numbers are required, GenerateReferenceNumber should be set to true and the ReferencePrefix and GeneratedReferenceNumberMapping fields are mandatory.

How to add reference numbers

Creating a new reference number provider

Payment Amount

Setting SavePaymentAmount to true specifies that the payment amount should included in the list of answers submitted. NOTE: If a form has a SubmitAndPay behaviour this will happen by default, the purpose of this is for internal forms used by staff where a payment amount is calculated but the payment itself is not handled by the form. The default answer key for the payment amount is PaymentAmount but you can use PaymentAmountTargetMapping to override this to your own preferred key.

Post Payment Callback Handling

Setting ProcessPaymentCallbackResponse to true will enforce the checking of a successful callback, redirecting the user to a failure page that will instruct them to call the number provided in CallbackFailureContactNumber quoting their case reference. If ProcessPaymentCallbackResponse is true then CallbackFailureContactNumber cannot be empty.

Breadcrumbs

Add breadcrumbs for success page and endpoint pages which require them.

How to add Breadcrumbs

Form Actions

Add actions to be completed when the form is submitted eg. send an email.

How to add Form Actions

Pages

You will now need to define some pages for your form, Pages are placed within the Pages array.

{
    "FormName": "Test form",
    "BaseURL": "test-form",
    "StartPageUrl": "https://www.stockport.gov.uk/start/iag",
    "FirstPageSlug": "page-one",
    "Pages": []
}

How to build a page