"Profile variables give expressions access to data values connected to a layer, map, or workspace. These values are the inputs to the expression, required for producing a valid return value as defined by the expression author. For example $feature provides expressions access to a feature's attributes and geometries. "
https://developers.arcgis.com/javascript/latest/arcade/
There is no possibility to access layers in expressions?
IIF($layerA.status == 'ERROR', 1, ...
(maybe it's an idea instead of a question)
https://developers.arcgis.com/arcade/profiles/visualization/#profile-variables
Thanks