I'm working on a field maps app for inspections. I have a layer that are features and a related table for the inspections. I was the item type from the feature to fill a field in the related table called "Inspection Type". My code works to make this happen, but I want to display the alias instead. Is this possible. This is the code that works and will return "flammable_materials_locker".
Try using the DomainName function: https://developers.arcgis.com/arcade/function-reference/feature_functions/#domainname
Might be somehting like the following but syntax untested:
// Get the feature set for the hydrants
var inspections = FeatureSetByRelationshipName($feature, 'SMS_Inspection_inspection', ['item'], true)
// Get the first hydrant (should only be one)
var inspection = First(inspections)
// If there was a hydrant, return the facilityid of it,
// Otherwise, return null
if (!IsEmpty(inspection)) {
return DomainName(inspection, 'item')
} else {
return null
}