Select to view content in your preferred language

Omit Fields without data from the Pop up Window on Online MapViewer

1504
17
Jump to solution
02-16-2025 04:49 PM
WFCAdmin
Occasional Contributor

I am making an online experience and need help with Pop-ups

I have a point layer that contains my company's environmental DNA sample results. There are over 1000 data points, containing information on over 20 species. The point attributes include 46 fields.

When a point is selected in the map, I would like the viewer to only see those fields in the pop-up window that have data for that particular point, instead of having to scroll through 46 fields to find the pertinent DNA results.

 

For example,

For this point, I would like the following pop-up window to omit all the empty rows (red slashes).

WFCAdmin_0-1739752969726.png

Can someone help me with this appropriate arcade expression?

I prefer the default pop-up look. No fancy headings or color are needed.

If you could provide an example that would be great!

Here are a couple of the fields in my data set.

Chinook_Salmon_DNA_Detected_ 
 
NumPos_ChinookWells 
 
Coho_Salmon_DNA_Detected_ 
 

NumPos_CohoWells

Bull_Trout_DNA_Detected_
 

NumPos_BullTWells

Thank you!!

0 Kudos
17 Replies
WFCAdmin
Occasional Contributor

No.

Just to be 100% sure, is this what yours looks like?

WFCAdmin_0-1740065548564.png

 

0 Kudos
RhettZufelt
MVP Notable Contributor

Is there anything under the Attribute Expressions section:

RhettZufelt_0-1740071300886.png

R_

0 Kudos
WFCAdmin
Occasional Contributor

Yeah, it's empty, no expressions saved there.

Its bizzar. The first time I load up the web map the popups work perfectly. Then, if I click on a second point - nothing, just the title pops up.

0 Kudos
WFCAdmin
Occasional Contributor

Even more weird. If I click on another layer in the layers pane, then click back on the layer with the pop-ups, the pop-up functions properly. If i stay selected on the pop-up layer and select another point, the popups stop functioning. But if I then select another layer in the layers pain, then select my pop up layer again it works again. Its like the popup window only functions the first time, then needs to be reset!

0 Kudos
WFCAdmin
Occasional Contributor

Thank you RhettZufelt!

So here is the issue that I am having.

If I simply have my title and the arcade expression I get only the title in the pop-up.

If I have the title, the field list with all 46 fields checked on, and the arcade expression, I get the full list followed by the abbreviated list. The abbreviated list works perfectly this way always filtering out the empty fields, but it defeats the purpose because the pop-up is still clogged with a bunch of blank data to scroll through.

Any suggestions?

0 Kudos
Yeaton
by
Occasional Contributor

Hi gis_KIWI4,

I am following the advice you provided in this post to modifiy my pop up attribute tables. I copy and paste the script you shared and modified for excluded values.  Unfortunately, when embedding the script in the map even the attributes that have values are omitted from the pop up table.  Do you have any insights into this?  Much appreciated!

Best,

A. Yeaton

 

0 Kudos
WFCAdmin
Occasional Contributor

It does work!

It just takes about 1-2 minutes to load the popup.

It looks like it defaults to ordering the fields alphabetically. Is there any way to correct this?

Thank you again!

RhettZufelt
MVP Notable Contributor

I don't really see any difference in performance using this vs. the Field List but I only have 33 fields and 1100 features.

I'm pretty new to this kind of Arcade myself, but saw this post and had the need to incorporate it into some existing maps.

However, I do not see a way to have it non alphabetical.  The script seems to be returning the Fields in the right order, but they get automagically re-ordered in the popup.

Hopefully @gis_KIWI4 or someone with a better understanding of this can figure out a way.

If I get a chance in the future, may dive into this more.

R_