0

I am trying to create 2 classes of symbol based on attributes.

I refer to this doc: https://pro.arcgis.com/fr/pro-app/latest/help/mapping/layer-properties/set-custom-expressions-for-symbology.htm

Therefore create this arcade expression:

var example_array = [1, 2, 3, 4];
if (IndexOf(example_array, $feature.ccogrm_0) > -1) {
return “Public”;
} else {
return “Privé”;
}

But when testing it, got this error message: Expression not valid Error on line 3 id expected

I hoped for an esay going thing when only trying to create 2 classes of attribute but one again things got deep with Esri.

Is there any other method to create classes based on text values? Like this but in arcade

if value in $feature.exemple is 'exemple1' then class = "Class A"
if value in $feature.exemple is 'exemple2' then class = "ClassB"
if value in $feature.exemple is 'exemple3' then class = "ClassA"

4
  • Your indentation looks astray. Is what you are presenting what you actually have?
    – PolyGeo
    Commented Jul 5, 2023 at 7:49
  • yes 1, 2, 3 and 4 are values on the ccogrm_0 field. But maybe there are set as text and not integer. How can I use text as feature selection?
    – Arthur
    Commented Jul 5, 2023 at 8:44
  • 1
    Have you tried avoiding that acute accent and used "Private" instead? Also, make sure that you're using straight double quotes rather than curly double quotes.
    – PolyGeo
    Commented Jul 5, 2023 at 9:16
  • curly double quote was the problem ! I only copy paste from Esri website and didn't think to check it. Cheers ! Now expression is valid, but ArcGis is running it for 45min+ now ...
    – Arthur
    Commented Jul 5, 2023 at 11:38

1 Answer 1

0

As stated by @PolyGeo, curly double quotes were the problem !

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.