add reference numbers - smbc-digital/form-builder GitHub Wiki
Generating Reference Numbers
Form builder can provide reference numbers if required. This is provided by a basic reference number provider implementation, in order for a form to generate numbers the GenerateReferenceNumber
, GeneratedReferenceNumberMapping
and ReferencePrefix
values must be provided.
For example:
{
"FormName": "",
"BaseURL": "",
"StartPageUrl": "",
"FirstPageSlug": "",
"GenerateReferenceNumber": true,
"GeneratedReferenceNumberMapping": "CaseReference",
"ReferencePrefix": "TEST-",
}
Reference number will be generated and added to form and pre-submit, this will use the GeneratedReferenceNumberMapping
in the submitted answers, the generated portion of the reference number will be prefixed with the ReferencePrefix
, in the example above a submission could look like;
{
"CaseReference": "TEST-A1b2C3",
...
}
PLEASE NOTE - There is the possibility of generating duplicate reference numbers, it's wise to check the generated number hasn't been used previously.