how can I make label using arcade that has multiple values

317
4
08-21-2019 02:48 PM
ScottShenberger
New Contributor III

I am trying to create an arcade expression that will pull only part of an attribute field. We track multiple document numbers in a field called DocumentNumber. Each document is separated by an !. I want to create a label from just the first document number. For example, I can have a document number field that looks like PN 123-4567!FN 1234 or FN 4567!PN 7654-123 (although document numbers vary by length depending on type) I would like to create a label based on the first value of the document number field which is where I am struggling

Thank you

Tags (1)
0 Kudos
4 Replies
XanderBakker
Esri Esteemed Contributor

Hi Scott Shenberger ,

Could you try this:

return Split($feature.DocumentNumber, '!')[0];
ScottShenberger
New Contributor III

That looks like it did the trick! Thank you so much. Im learning Arcade on the fly so this was stumping me.

BenBaker1
Occasional Contributor

I'm trying to create a similar expression, although I need the expression to then sum the values from inspection types that are coded into a survey123 form. The question is a select_multiple type, because they may complete more than one inspection type during a single survey, but then I'd like to be able to summarize the number of EACH inspection in a Dashboard (now that Arcade is supported in indicators). 

I have a formula in Excel that will parse the field and sum the individual values, but I would like to keep things on the ESRI platform, if possible.

Excel formula to find all '100' (Annual) inspection types:

I'm not sure how to make the jump from Split to summing the values, or if another function (GroupBy?) might better achieve what I'm wanting.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi bbaker_mhgis , 

Although the new ArcGIS Dashboard (beta) has support for Arcade in the indicators, I am not sure if you can do a count of all values that contain a certain string. 

0 Kudos