What are Record Mappings?
Matchers tell the CAD that two fields hold the same kind of data, even when their labels differ. A "First Name" field and a "Given Name" field only link if both use the matcher first_name. You set matchers on fields in the Template Editor.
Matchers power Search fill, Run, Record Search, unique checks and charge totals. Leave the matcher blank on fields that don't need any of these.
There are two kinds:
| Kind | Set on | Example |
|---|---|---|
| Field matcher | The field itself | first_name, veh_plate, sex |
| Option matcher | Each choice on a Select, Multiple Choice or Checkboxes field | male, female and other on a Sex field |
A matcher can only use lowercase letters and underscores, up to 64 characters. Searches and unique checks ignore letter case.
Search Fill
Search fill on a Standard section finds a record, then copies its data into the section.
- Find the Record
Officers search using the sources you turned on for that section. You can turn on more than one.
- Copy Every Shared Matcher
The CAD copies every field on the found record whose matcher also exists in this section. Searching a civilian by name can fill sex, phone number and address too, not just the name.
| Source | Officers search by |
|---|---|
| Civilian | First name, last name and date of birth (plus middle initial and alias, if the template has them) |
| Vehicle | Plate |
| Licence | Licence number |
| Custom search | The fields on one of your search indices |
| Record ID | The record's number |
Copying skips fields with no matcher, read-only fields and supervisor-only fields unless the author is a supervisor. Values are fitted to the destination's input mask, and can move between field types, for example a date into a text field.
Matching Choices
When the destination is a choice field, the CAD first picks the option with the same option matcher. If none match, it falls back to the option with the same label, ignoring case.
Built-in Matchers
The CAD recognizes these matchers. You can make up your own, like phone_number or case_number, for anything else. Some types need certain matchers before they'll save. See Required fields.
Option Matchers
Each choice on a choice field has its own matcher box next to its label. Use option matchers when two templates word the same choice differently, or when the CAD needs to pick a choice for you.
| Field matcher | Option matchers | Selected when |
|---|---|---|
sex | male, female, other | Search fill copies sex between records |
licence_status | valid, suspended, expired | The licence is in that state |
charges_held_for_bond | yes, no | Any charge on the record holds for bond, or none do |
Flags
Tick the flag box on a choice to show its label as a red alert whenever that choice is picked. Runs play the flag tone, and on the Police panel the alert is sent to dispatch. A common setup is a Flags field with options like Armed or Violent marked as flags. See Alerts and Warnings.
Charge Matchers
Put these on fields in a Standard section to show totals from the charges on the same record. The CAD fills them in and locks them. The record still needs a Charges section.
| Matcher | Shows |
|---|---|
charges_fine_subtotal | Fines before surcharges |
charges_fine_total | Fines including surcharges |
charges_points | Total licence points |
charges_jail_total | Total jail days |
charges_bond | Bond owed |
charges_held_for_bond | Whether any charge holds for bond: Yes or No as text, 1 or 0 as a number or a choice with yes and no option matchers |
charges_surcharge_ + name | One surcharge's amount: add the surcharge's abbreviation, name or ID in lowercase, like charges_surcharge_cc |
Text fields show money with your currency symbol and jail as days.
Traffic and speeding charges also apply their points and suspensions to the licence whose number is in a licence_number field on the same record.
Unique Fields
Text, text area, number, date, time and random fields can be unique.
| Unique type | Rule |
|---|---|
| Not Unique | No check |
| Local | No other record can reuse the value in this field |
| Global | No other record can reuse the value in any field with the same matcher |
Use Global on licence_number and veh_plate so plates and licence numbers stay unique across your CAD. Only Random fields can be both unique and read-only.
Search Indices and Dependencies
Search indices search records by your own matchers, like phone_number. Each one adds a Record Search tab and a Search fill source. Run doesn't use them. A match still copies every shared matcher, not just the ones you searched by.
Fields hidden by a dependency don't count toward required matchers, so keep identity fields like first_name and veh_plate in sections that are always visible.
Need help?
Still have questions? Join our Discord server for support from the Melonly Team.