Select to view content in your preferred language

Incident Number "Starts with" Constraint Idea Help

212
2
03-05-2025 03:58 PM
Teresa_Blader
Frequent Contributor

Soliciting for ideas with the goal of a constraint checking a string with input mask of 9999-99999999 starts with YYYY-00 or YYYY-002.

I have a complex workflow where 911 calls are ingested using ArcGIS Velocity, but Survey123 is also used in edit mode in a dashboard to add additional details to that call for related programs.

The users (responders) utilizing the form normally see the incident numbers formatted like: 2025-0200201 from their records management system, but the 911 system uses 2025-00200201. Now when ArcGIS Velocity hits the database, the API query doesn't catch every incident until the right 911 call notes appear and so responders can also use survey123 to log "missing incidents" which submits to the same database that ArcGIS Velocity does - sometimes there's just a lapse in time - so like someone logs 2025-00200201 as missing and then when the API catches up, it overwrites the API related attributes and leaves the Survey123 attributes as logged - all caught up. Great. 

SOMETIMES responders log the missing incident number incorrectly and so I'm trying to come up with more rules to control their errors. Most of the time it's like 2025-00020201 or 2025-02000021 so I'd like to have a constraint that somehow checks they at least got it starting like 2025-002 

It is unlikely in my community we will get past 2025-00299999 and then it starts over in 2026 etc.

I've already got the typical input mask for 9999-99999999, and I check for existing incidents in the database using pull data so they can't submit a duplicate at least.... but I'm still getting bad entries haha

So just soliciting for other potential ideas with the goal of the constraint is checking that it starts with YYYY-00 or YYYY-002.

 

And if you're at the Dev Summit next week, come to my presentation on this project! March 12 2025 3:15 PDT Mesquite B 🙂

Teresa Blader
Olmsted County GIS
GIS Analyst - GIS Solutions
2 Replies
DougBrowning
MVP Esteemed Contributor

I am guessing it is a string so maybe substr(question, start, end) could work?

0 Kudos
LaurenceTait
Frequent Contributor

You need to use a regex. I've attached an example of that.

However...

I wouldn't do it quite that way.  Your number has two known, and largely invariant, portions. It is suboptimal to ask users to enter those portions manually. That in unnecessary work, it will increase the likelihood of errors, and also make it much harder to isolate where the error occurred.

What I would suggest is that you have the year hardwired, have a limited drop down for the first three digits, and only require the user to manually enter the last 5 digits.

LaurenceTait_0-1741764694436.png

With only 5 characters to enter, rather, than 13, you reduce the opportunity for error by ~60%.

Capture.JPG

0 Kudos