Select to view content in your preferred language

Hide data features (lines of data) in Field Maps

520
6
Jump to solution
08-05-2024 10:43 AM
SarahJorgensen
Occasional Contributor

Hi all,

I have created a layer which will become a large dataset of flightlines of birds collected by surveyors in Field Maps. However, as time progresses through the project (it’s a 2 year project on the same site), I fear that the whole map in Field Maps will be covered in flight lines, which will be messy and difficult to work with.

So I’m wondering if there is a way to hide past features (flight lines) within the dataset from being visible to surveyors on Field Maps while still keeping the data in the layer?

Any thoughts or experience on this would be greatly appreciated. 

Thanks in advance. 

Sarah

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You can do this two ways.

The first would be to use Arcade in the Styles tab. An expression like this would return the flightlines for the last two years. You would have to turn off the Other category in the Style options section.

if(DateAdd(Now(), -2, 'years') < $feature['dateField']) return 'Recent flightlines'

Snag_13f58de.png

The other option is to use a Filter on the layer. The one drawback to that is it uses a hard-coded date instead of the flexible date (two years from today) that the Arcade code uses.

View solution in original post

6 Replies
KenBuja
MVP Esteemed Contributor

You can do this two ways.

The first would be to use Arcade in the Styles tab. An expression like this would return the flightlines for the last two years. You would have to turn off the Other category in the Style options section.

if(DateAdd(Now(), -2, 'years') < $feature['dateField']) return 'Recent flightlines'

Snag_13f58de.png

The other option is to use a Filter on the layer. The one drawback to that is it uses a hard-coded date instead of the flexible date (two years from today) that the Arcade code uses.

SarahJorgensen
Occasional Contributor

@KenBuja thank you!

I looked at both options you suggested and I think that because there will be new flightline data entered every month from now, which I will need to hide on the Field Map (so that surveyors have a clean map to work off at the beginning of each month), the simple Filter option should work well.

I'm new to ArcGIS so I didn't know about the Filter function before. I'll see how it goes. Thanks again.

0 Kudos
ZachBodenner
MVP Regular Contributor

Was this layer created as a hosted layer in your online portal, or was it published from Pro? If the later, you could do this just with a definition query in the Pro document. As long as you have a field indicating when the observation took place, you could restrict the visibility that way.

Happy mapping,
- Zach
SarahJorgensen
Occasional Contributor

@ZachBodenner Thanks for your input. I created it in the online portal. But good to know how this can be done in Pro.

0 Kudos
MitchellGrafstein
Frequent Contributor

Are all surveyors working online?  Or Offline?

I suggest creating a field you will use for visibility.  We can call it something like "visible", and then you can set it to Yes or No.  If this does not describe your work properly, you can use something different "historical" or something along those lines.  Since you want these visible in the field, you can have staff use the Field Maps filter to select/deselect historical records.  

You can also create two views if you wish, and have one view show historical records (and have it off in the map by default) and another which shows current records (where your visibility, historical, or whatever you call it field is set to 'Active' or 'Yes' or just simply leave it blank.  Use a text field for filtering, as these will give you options in Field Maps.  Create a simple domain (list) for the new field - you can start with just 'Yes' and 'No' as the codedValues.

Just a warning in advance, if you create views, be sure to handle for nulls and empty strings.  Best to test your views first before you add them to a map. 

Historical View:  historical IN ('Yes')

(I believe in the web interface for the historical view should state historical INCLUDES Yes)

Live View: historical NOT IN ('Yes') OR historical is NULL

(I believe in the web interface the live vie will be historical EXCLUDES Yes or historical is EMPTY)

Honestly, it is quite confusing how the web interface where you set the view definition describes things. I believe when you choose "EMPTY" it changes the definition using NULL.  However, this does not include the case of the empty string '' and the interface really goes back and forth in how it describes these things.  

To cover your bases, for your live view - you're excluding the values so this should include the empty string case.  However, you also have to handle Nulls, which in this case is "EMPTY" in the web interface but the definition will show it adds Null values to the OR.

Make sure you add a set for the live view where either case can be True (using a logical OR.)

I probably could have worded that better, so let me know if you have any questions.

If everything is done correctly, after you calculate the historical values to 'Yes' or 'Historical' or whatever you want, you should have the total records add up between the two views to be the total number of records in the source layer.

We had offline areas fail when using a date filter in a view just as an FYI.  Not sure if this has been fixed in the latest AGOL update, but something to be wary of.  If working online, this will be less of an issue and a possible solution, as well. 

A few ways to tackle the problem, so hopefully this is some food for thought.

I hope this helps.

Mitchell Grafstein, Horticultural Inspector 1, NYS Dept. of Agriculture and Markets
SarahJorgensen
Occasional Contributor

@MitchellGrafstein Thank you for your very detailed suggestion.

My team will be working on iPads with data connectivity so they'll be online for the most part.

As mentioned above, I think a simple date filter should work for us. But if I run into issues with that, I'll certainly come back to you suggestion and may return to you for some more advice.

Thanks again.

S