If you need to validate form fields use server side validation. An example of where server side validation could be used would be validating an address is within your desired state or postcode. 



Configuration

Add your custom URL or a hosted API endpoint and secret to the form summary page. This will allow you to call this endpoint once prior to submission and once before your workflow begins. 



Validation Fails


If the validations fails on the first call prior to the submission the user will be shown a failure modal. This can be used to include an informative error message explaining why the form failed the validation. For example, "The address you are using is not within the expected Postcode."


If the validation fails on the second call prior to the workflow then a email will be sent to the notification email address configured for the app that the form is being submitted from.  


If the validation succeeds the form will be submitted as normal.



Example Payload


{
  "formsAppId": 1,
  "formId": 1,
  "externalId": "external identifier",
  "secret": "ssshhh",
  "submissionId": "85fad0a4-b778-4aea-a6e7-671d84d58156",
  "submissionTimestamp": "2018-01-01T00:00:00.000Z",
  "jobId": "29e8138d-b28c-49da-b357-f4974adbf0a6",
  "previousFormSubmissionApprovalId": "04dc6796-f593-47a6-ac21-5e00473d86a1",
  "submission": {
    "First_Name": "Jane",
    "Last_Name": "Smith"
  },
  "ipAddress": "86.124.75.76",
  "keyId": "",
  "user": {
    "userId": "81798353-7c7a-481b-89f2-8c5fb83209ca",
    "providerType": "Google",
    "providerUserId": "234891839120312839123",
    "username": "jane@smith.io",
    "email": "jane@smith.io",
    "firstName": "Jane",
    "lastName": "Smith",
    "fullName": "Jane Smith",
    "picture": "https://lh3.googleusercontent.com/a/AATXAJyQ6F_frDWNQguRuVrRmKKs22PYkXDTQlzgDRjp=s96-c"
  },
  "device": {
    "type": "BROWSER",
    "appCodeName": "Mozilla",
    "appName": "Netscape",
    "appVersion": "5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
    "cookieEnabled": true,
    "hardwareConcurrency": 12,
    "language": "en-GB",
    "maxTouchPoints": 0,
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
    "vendor": "Google Inc.",
    "webdriver": false
  }
}


Note: The first call prior to submission will not include the submission ID, Submission timestamp, secret, IP address, and device information.



Example

For an example of Server Side Validation check our our GitHub link here



Get Help

If you have any question or would like assistance with setting up your Server Side Validation please contact us via this support portal or email support@oneblink.io. We are happy to assist in any way we can.