Base implementation setup & creating new reference number providers
Formbuilder comes with a basic reference number generator form_builder.Providers.ReferenceNumbers.ReferenceNumberProvider
. It's based roughly on the code in the accepted answer on this stackoverflow post.
The intention is to keep the chances of potential reference duplication high while maintain ease of reading and reasonable length.
You can specify the characters to be used for reference generation in appsettings.config
in the ValidReferenceCharacters
option the default is below.
"ValidReferenceCharacters": "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
Assuming 8 random characters, this gives 218,340,105584896 (over 218 trillion) possible combinations, this can be increased by either, adding more valid reference characters or increasing the number of characters used in a reference number.
A new implementation which could use for example other more complex algothims, external providers or database driven reference numbers can be created by implementing the IReferenceNumberProvider
interface, this only has a single method string GetReference(string prefix, int length)
.
Register this in the application startup.
services.AddTransient<IReferenceNumberProvider, MyNewReferenceNumberProvider>();
Formbuilder only currently supports a single universal reference number provider per implementation of the app.
- Availability
- Actions
- Behaviours
- Breadcrumbs
-
Conditions
- String Conditions
- Date Conditions
- Integer Conditions
- File Upload Conditions
- Custom validation
-
Elements
- AddAnother
- Address
- Button
- Booking
- Checkbox
- Date Input
- Date Picker
- Declaration
- Document Download
- Document Upload
- File Upload
- H1-H6
- HR
- Image
- Inline Alert
- Link
- Map
- Multiple File Upload
- OrderedList
- Organisation
- P
- Radio
- Select
- Street
- Summary
- Success page
- Textarea
- Textbox
- Time input
- Unordered List
- Uploaded files summary
- Warning
- EnabledFor
- Feedback form
- File uploads
- Form Schema
- Header
- Inbound Values
- Integrating with PowerAutomate/0365
- Lookup
- Page
- Payment & Payment calculations
- Preview data structure
- Render conditions
- Reusable elements
- Structure tests
- Success page
- Tag parsers
- Target mapping
- Validators