You could use some logic similar to this:
var search_duplicate = $feature.FACILITYID
var features = FEATURESETBYNAME($datastore, "Featureclass Name Here")
var sqlExpression = "A_FIELD_NAME_HERE = @search_duplicate"
var result = FILTER(features, sqlExpression)
WHEN(
COUNT(result) > 1, `Duplicate Value, choose another ID`,
$feature.FACILITYID
)
Or you could use a sequence:
https://support.esri.com/en-us/knowledge-base/how-to-add-auto-sequential-values-using-attribute-rule...
Also, this post has a great solution to what you're asking for:
https://community.esri.com/t5/arcgis-field-maps-questions/arcgis-fieldmaps-form-calculate-expression...