3

I am making a dashboard in ArcGIS Online. (see figure)

dashboard view, with a map on the left, list in the middle and bar diagram on the right

I want to create a list for users to select their biomass of interest and use them as a filter for the diagrams on the right. The current names in the list are ugly (for lack of a better word). I want to remove everything contained in brackets. For this purpose, I used Arcade's Split() function as follows:

Split(Text($datapoint["Nom_biomasse"])," (",1)[0]

However, the result is still the exact same as $datapoint["Nom_biomasse"] (the field containing the biomass names) on its own.

Is there something I am doing wrong or is this just something that cannot be done with dashboard lists?

It seems the Split() function inside the expression works fine. However, I am unable to reference it in the list itself.

1 Answer 1

4

I figured it out eventually. May this serve as an illustration to the ArcGIS online help.

When enabling advanced formatting, there is a sample code available. My mistake was to ignore this sample code and write my expression from scratch. Following the sample structure, here is my current Arcade expression:

return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  attributes: {
        attribute2: Split($datapoint["Nom_biomasse"], " (")[0]
  }
}

The attribute2 can then be referenced in the list with the following expression:

{expression/attribute2}

(see figure) enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.