2

I have been using Arcade expressions for custom popups. These are being authored in ArcGIS Pro for later deployment to AGOL.

These expressions are all being named, can be successfully embedded in the pop-up title and text elements, and are also listed in the fields list.

As these expressions grow in complexity I find I am copy/pasting snippets from one expression to another, I would like to avoid this duplication.

I have tried to extract the common logic to a separate expression but don't seem to be able to call one expression from another.

As an example I have an expression named SAMPLE_NAME and it can be embedded in the title as {expression/SAMPLE_NAME}.

However each of the following lines produces a "Field not found..." error.

var a = $feature["SAMPLE_NAME"];
var b = $feature["expression/SAMPLE_NAME"];
var c = $feature["{expression/SAMPLE_NAME}"];
var d = $feature.SAMPLE_NAME;

Is it possible to call one expression from another? If so how?

Alternatively can I export/import functions between expressions or otherwise reduce the need to duplicate code?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.