Select to view content in your preferred language

Getting a collection of WebMaps that are available to FieldMaps in my ArcGIS Online portal

336
5
Jump to solution
04-23-2024 01:27 PM
Dirk_Vandervoort
New Contributor III

Here's code, the query is not quite right, it does not return the 8 known FieldMaps out of the 100's of WebMaps we have. Instead it returns about 30.

    items = gis.content.search(query=' type: "Web Map" AND NOT typekeywords: "FieldMapsDisabled"', max_items=1000)
    for item in items:
        print(item.resources.list())

 BTW item.resources.list() returns empty.

"FieldMapsDisabled" is about the only reference to FieldMaps content that the Python API appears to directly access.

As you can see, I am inventorying our live field activities using field data collection in ArcGIS as a proxy.

TIA again!

0 Kudos
1 Solution

Accepted Solutions
Dirk_Vandervoort
New Contributor III

After looking at the network traffic in FieldMaps Designer, I have managed to reconcile all active FieldMaps with a query:

(Access:shared OR Access:private) AND orgid:BLAHBLAHBLAH AND NOT typekeywords:FieldMapsDisabled AND type:"Web Map" AND NOT typekeywords:"Workforce Project" AND NOT typekeywords:"Workforce Dispatcher" AND NOT typekeywords:"Workforce Worker"

View solution in original post

0 Kudos
5 Replies
EarlMedina
Esri Regular Contributor

I think this might be a case where it would be preferable to tag/categorize your production collection maps in a meaningful way so as to distinguish them from Web Maps with other usages (including field maps used only for test purposes, for example). This would make for better, more reliable results with no false positives.

0 Kudos
Clubdebambos
Occasional Contributor III

Hi @Dirk_Vandervoort 

I'm not sure the below will work but would like to see the results as I only have a handful of Web Maps to test on, and while it works for those, I'm interested to see if it works for your situation, or if it returns the same results.

 

from arcgis.gis import GIS

## access agol
agol = GIS("home")

## get wm items where "FieldMapsDisabled" is not present
webmap_items = [wm for wm in agol.content.search("type:Web Map", max_items=1000) if "FieldMapsDisabled" not in wm["typeKeywords"]]

## check length of list returned
print(len(webmap_items))

## print list to check items
for wm in webmap_items:
    print(wm)

 

 

~ learn.finaldraftmapping.com
0 Kudos
Dirk_Vandervoort
New Contributor III

That query seems to return many false positives. Not sure the query is helping.

Interestingly:

https://<MY_PORTAL>.maps.arcgis.com/apps/fieldmaps/maps

indicates that my ArcGIS Online portal is aware of which of my WebMaps are participating in FieldMaps.

I'd like to avoid a tag-based solution for now. For reference, I am asking the question "when and where did my users collect data using FieldMaps for all maps in my portal yesterday?".

0 Kudos
EarlMedina
Esri Regular Contributor

To me, that sounds like you're heading into web hook / custom solution territory. Not impossible to do, but if you are really wondering when and where (in a geographic sense) data was collected, this will require some work. 

At least in my case, /app/fieldmaps/maps seems to return the maps which I own that could support Field Maps. I however, am not using ANY of the results for field collection so I don't think you can use this as an approximation.

In fact, that endpoint actually just returns a search result that uses this query string:

orgid:<orgId> AND NOT typekeywords:FieldMapsDisabled AND type:"Web Map" (owner:<username>) AND NOT typekeywords:"Workforce Project" AND NOT typekeywords:"Workforce Dispatcher" AND NOT typekeywords:"Workforce Worker"

 
Dirk_Vandervoort
New Contributor III

After looking at the network traffic in FieldMaps Designer, I have managed to reconcile all active FieldMaps with a query:

(Access:shared OR Access:private) AND orgid:BLAHBLAHBLAH AND NOT typekeywords:FieldMapsDisabled AND type:"Web Map" AND NOT typekeywords:"Workforce Project" AND NOT typekeywords:"Workforce Dispatcher" AND NOT typekeywords:"Workforce Worker"
0 Kudos