Is there a way to use an Arcade Expression from the General Popup Window in the Cluster Pop-up Window?

303
9
Jump to solution
01-30-2019 06:45 AM
NicoKroes2
New Contributor III

Hello:

Would anyone know of a way to use an Arcade Attribute Expression that was created in the General 'Configure Pop-up' window inside of the 'Configure Clustering Popup' Window Custom Attribute Display? What I am attempting to do is to use an Arcade attribute expression to provide meaningful names for the point classes of some address points. For Example, instead of 'Residential - Single Structure', below. I would like for the class to read 'Residential Structure' or 'House' (See Figure 1). I am able to do this for in the Popups for individual address points. However, I am unable to do this for Popups depicting clusters of address points.

Figure 1

The problem that I am running into is that I am unable to access any of the arcade expressions that I created inside of the General 'Configure Pop-up' Window (See Figure 2).

Figure 2

Please let me know if I can provide any additional information that might help.

Thanks

Nico

0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi Nico Kroes ,

The cluster window does not have the possibility to use Arcade functions to change the pop-up window. However, you can use an Arcade expression for the symbology and change the names as you want them to appear and that will be used in the cluster pop-up window.

Let's take a small example. I have a set of points that I symbolize on a field called CLASE_USO. There are a couple of values that contain the word "ESTRATO":

Which makes the cluster pop-up to appear like this:

If I want the text "ESTRATO" to be replaced by "LEVEL" I can create an expression for the symbology:

 

This  expression in my case will just have a replace to change the text:

This will change the visualization (the legend actually):

If you go into the configuration of the cluster pop-up you will see that it is using an expression with a strange kong name. This is the expression based on your expression used for the symbology:

The result will like like this:

View solution in original post

9 Replies
XanderBakker
Esri Esteemed Contributor

Hi Nico Kroes ,

The cluster window does not have the possibility to use Arcade functions to change the pop-up window. However, you can use an Arcade expression for the symbology and change the names as you want them to appear and that will be used in the cluster pop-up window.

Let's take a small example. I have a set of points that I symbolize on a field called CLASE_USO. There are a couple of values that contain the word "ESTRATO":

Which makes the cluster pop-up to appear like this:

If I want the text "ESTRATO" to be replaced by "LEVEL" I can create an expression for the symbology:

 

This  expression in my case will just have a replace to change the text:

This will change the visualization (the legend actually):

If you go into the configuration of the cluster pop-up you will see that it is using an expression with a strange kong name. This is the expression based on your expression used for the symbology:

The result will like like this:

View solution in original post

NicoKroes2
New Contributor III

Thanks Xander Bakker‌. This solution worked for my needs. In addition to what you stated above, I added the Replace Functions inside several if statements to ensure that I was changing each point class name was changed exactly to what I needed. Without doing this, I was only able to replace one or two point class names at a time. Please correct me if I am wrong in this assertion.

Thank you for your help with this.

Nico

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Nico Kroes ,

Could you provide the code as text (just copy and paste in this thread) so I can actually see what the input and output values are? Based on that I can provide you with a more condensed expression to do the job. 

Thanks!

0 Kudos
NicoKroes2
New Contributor III

Yes, certainly. Here is the code for the arcade expression:

   

if ($feature.PtClass == 'Commercial - Single Structure') {
   return Replace($feature['PtClass'],'Commercial - Single Structure','Commercial Structure')
}

if ($feature.PtClass == 'Commercial - Suite') {
   return Replace($feature['PtClass'],'Commercial - Suite','Office Suite')
}

if ($feature.PtClass == 'Educational - Library') {
   return Replace($feature['PtClass'],'Educational - Library','Library')
}

   if ($feature.PtClass == 'Educational - School (Private)') {
return Replace($feature['PtClass'],'Educational - School (Private)','Private School')
}

if ($feature.PtClass == 'Educational - School (Public)') {
   return Replace($feature['PtClass'],'Educational - School (Public)','Public School')
}

if ($feature.PtClass == 'Emergency - Fire') {
   return Replace($feature['PtClass'],'Emergency - Fire','Fire Department Facility')
}

if ($feature.PtClass == 'Emergency - Hospital') {
   return Replace($feature['PtClass'],'Emergency - Hospital','Hospital')
}

if ($feature.PtClass == 'Emergency - Police') {
   return Replace($feature['PtClass'],'Emergency - Police','Police Department Facility')
}

if ($feature.PtClass == 'Government Office - Local') {
   return Replace($feature['PtClass'],'Government Office - Local','Local Government Facility')
}

if ($feature.PtClass == 'Nonbuilding Structure - Cell Tower') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Cell Tower','Cellular Tower')
}

if ($feature.PtClass == 'Nonbuilding Structure - City Govt Asset') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - City Govt Asset','City Government Asset')
}

if ($feature.PtClass == 'Nonbuilding Structure - Detention Pond') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Detention Pond','Detention Pond')
}

if ($feature.PtClass == 'Nonbuilding Structure - Electrical') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Electrical','Electrical Structure')
}

if ($feature.PtClass == 'Nonbuilding Structure - Electrical Box') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Electrical Box','Electrical Box')
}

if ($feature.PtClass == 'Nonbuilding Structure - Monument/Sign') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Monument/Sign','Monument or Sign')
}

if ($feature.PtClass == 'Nonbuilding Structure - Parking') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Parking','Parking Structure')
}

if ($feature.PtClass == 'Nonbuilding Structure - Phone Cabinet') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Phone Cabinet','Phone Cabinet')
}

if ($feature.PtClass == 'Nonbuilding Structure - Trash Compactor') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Trash Compactor','Trash Compactor')
}

if ($feature.PtClass == 'Nonbuilding Structure - Water Meter') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Water Meter','Water Meter')
}

if ($feature.PtClass == 'Nonbuilding Structure - Cable Box') {
   return Replace($feature['PtClass'],'Nonbuilding Structure - Cable Box','Cable Box')
}

if ($feature.PtClass == 'Recreational/Cultural - Private') {
   return Replace($feature['PtClass'],'Recreational/Cultural - Private','Private Recreational/Cultural Structure')
}

if ($feature.PtClass == 'Recreational/Cultural - Public') {
   return Replace($feature['PtClass'],'Recreational/Cultural - Public','Public Recreational/Cultural Structure')
}

if ($feature.PtClass == 'Religious/Spiritual') {
   return Replace($feature['PtClass'],'Religious/Spiritual','Religious Structure')
}

if ($feature.PtClass == 'Residential - Apartment') {
   return Replace($feature['PtClass'],'Residential - Apartment','Apartment Unit')
}

if ($feature.PtClass == 'Residential - Apartment Building') {
   return Replace($feature['PtClass'],'Residential - Apartment Building','Apartment Building')
}

if ($feature.PtClass == 'Residential - Common Area') {
   return Replace($feature['PtClass'],'Residential - Common Area','Residential Common Area')
}

if ($feature.PtClass == 'Residential - Single Structure') {
   return Replace($feature['PtClass'],'Residential - Single Structure','Residential Structure')
}

if ($feature.PtClass == 'Residential - Unit') {
   return Replace($feature['PtClass'],'Residential - Unit','Residential Unit')
}

if ($feature.PtClass == 'Residential - Townhome') {
   return Replace($feature['PtClass'],'Residential - Townhome','Townhome')
}

if ($feature.PtClass == 'Residential - Group Quarters') {
   return Replace($feature['PtClass'],'Residential - Group Quarters','Group Living Facility')
}

if ($feature.PtClass == 'Residential - Condo') {
   return Replace($feature['PtClass'],'Residential - Condo','Condominium')
}

0 Kudos
XanderBakker
Esri Esteemed Contributor

Could you try this?

var in_text = $feature.PtClass;

return Decode(in_text, 'Commercial - Single Structure','Commercial Structure',
'Commercial - Suite','Office Suite',
'Educational - Library','Library',
'Educational - School (Private)','Private School',
'Educational - School (Public)','Public School',
'Emergency - Fire','Fire Department Facility',
'Emergency - Hospital','Hospital',
'Emergency - Police','Police Department Facility',
'Government Office - Local','Local Government Facility',
'Nonbuilding Structure - Cell Tower','Cellular Tower',
'Nonbuilding Structure - City Govt Asset','City Government Asset',
'Nonbuilding Structure - Detention Pond','Detention Pond',
'Nonbuilding Structure - Electrical','Electrical Structure',
'Nonbuilding Structure - Electrical Box','Electrical Box',
'Nonbuilding Structure - Monument/Sign','Monument or Sign',
'Nonbuilding Structure - Parking','Parking Structure',
'Nonbuilding Structure - Phone Cabinet','Phone Cabinet',
'Nonbuilding Structure - Trash Compactor','Trash Compactor',
'Nonbuilding Structure - Water Meter','Water Meter',
'Nonbuilding Structure - Cable Box','Cable Box',
'Recreational/Cultural - Private','Private Recreational/Cultural Structure',
'Recreational/Cultural - Public','Public Recreational/Cultural Structure',
'Religious/Spiritual','Religious Structure',
'Residential - Apartment','Apartment Unit',
'Residential - Apartment Building','Apartment Building',
'Residential - Common Area','Residential Common Area',
'Residential - Single Structure','Residential Structure',
'Residential - Unit','Residential Unit',
'Residential - Townhome','Townhome',
'Residential - Group Quarters','Group Living Facility',
'Residential - Condo','Condominium', in_text);
NicoKroes2
New Contributor III

Xander Bakker‌. I used the code below to add an alias to my address point class names in the legend and in the clustering popup. I also removed some address point classes that I did not need. I appreciate your help on this.

var in_text = $feature.PtClass;

Decode(in_text, 'Residential - Group Quarters', 'Group Living Facility',
'Commercial - Suite', 'Office Suite',
'Commercial - Single Structure', 'Commercial Structure',
'Residential - Single Structure', 'House or Detached Housing',
'Residential - Apartment', 'Apartment Unit',
'Residential - Apartment Building', 'Apartment Building',
'Residential - Unit', 'Residential Unit',
'Residential - Townhome', 'Townhome',
'Residential - Condo', 'Condominium', in_text);

Nico

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Nico Kroes ,

It is not entirely clear to me if the code works for you now. Does it?

0 Kudos
NicoKroes2
New Contributor III

Yes it does work. Apologies for the misunderstanding.

Nico

XanderBakker
Esri Esteemed Contributor

Thanks for getting back. Glad to hear that it's working now!

0 Kudos