Search Citizens
Performs a partial-match search across names and Citizen IDs in the database.
Export Syntax
exports['kartik-mdt']:SearchCitizens(query, limit)Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | - | Search term (partial firstname, lastname, or citizen ID) |
limit | number | No | 10 | Maximum results to return (capped at 50) |
Return Value
- Returns
tablecontaining an array of matched citizen listings:
{
{
citizenId = "QBX000123",
firstname = "John",
lastname = "Doe",
},
...
}Example Usage
local query = "John"
local results = exports['kartik-mdt']:SearchCitizens(query, 5)
print(string.format("Found %d matches:", #results))
for _, match in ipairs(results) do
print(string.format("- %s %s (%s)", match.firstname, match.lastname, match.citizenId))
end