Select to view content in your preferred language

Enable ObjectID field for Find Locations and web map url parameters

3367
7
Jump to solution
11-22-2018 08:50 AM
Lake_Country_GIS
Frequent Contributor

I would like to pass in a features OBJECTID as a web map URL parameter and zoom to that feature. It appears I cannot use OBJECTID on the Find Locations configuration portion of the Web Map settings page. I do not see that field in the available fields dropdown. Is it possible to allow the OBJECTID field to be searchable?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

You can do this using ArcGIS Online Assistant.

ArcGIS Online Assistant 

  1. Choose "I want to": "View an item's JSON"
  2. Go down to the "Data" window and click on the pencil button for edit.
  3. Edit the application properties > search > layers > field
    "applicationProperties": {
        "viewing": {
            "routing": {
                "enabled": true
            },
            "measure": {
                "enabled": true
            },
            "basemapGallery": {
                "enabled": true
            },
            "search": {
                "enabled": true,
                "disablePlaceFinder": false,
                "hintText": "Place or Address",
                "layers": [
                    {
                        "id": "Damage_Assessments_March_2018_8420",
                        "field": {
                            "name": "ObjectId",
                            "exactMatch": true,
                            "type": "esriFieldTypeOid"
                        }
                    }
                ]
            }
        }
    }

View solution in original post

7 Replies
RobertScheitlin__GISP
MVP Emeritus

You can do this using ArcGIS Online Assistant.

ArcGIS Online Assistant 

  1. Choose "I want to": "View an item's JSON"
  2. Go down to the "Data" window and click on the pencil button for edit.
  3. Edit the application properties > search > layers > field
    "applicationProperties": {
        "viewing": {
            "routing": {
                "enabled": true
            },
            "measure": {
                "enabled": true
            },
            "basemapGallery": {
                "enabled": true
            },
            "search": {
                "enabled": true,
                "disablePlaceFinder": false,
                "hintText": "Place or Address",
                "layers": [
                    {
                        "id": "Damage_Assessments_March_2018_8420",
                        "field": {
                            "name": "ObjectId",
                            "exactMatch": true,
                            "type": "esriFieldTypeOid"
                        }
                    }
                ]
            }
        }
    }
Lake_Country_GIS
Frequent Contributor

Thanks for the heads up and prompt reply. Then, is this the correct way to add to my URL?

/home/webmap/viewer.html?webmap=35094f1e8f6a4ef3be7791998e37008e&find=27

where '27' is a record with ObjectID=27

Thanks again,

Mark

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mark,

   Yes that is correct.

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos
Lake_Country_GIS
Frequent Contributor

Do you know if this functionality is supported in one of the original ArcGIS Online templates : "Edit Template"?

https://www.arcgis.com/home/item.html?id=48d017e94e3d4567a8b81b78352e63cd 

I can't seem to get the URL parmeter to work there.

Cheers,

Mark

0 Kudos
PanGIS
by
Frequent Contributor

@RobertScheitlin__GISP 

Hi Robert, this is great!

I wanted to ask you if it would be possible to enable it on GlobalId as well.

I am too afraid of screwing up everything. 😅

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

@PanGIS 

Sorry I do not know if that is possible or not.

ArmstKP
Frequent Contributor

@RobertScheitlin__GISP I followed your example and our OBJECTID field still doesn't show up in the webmap settings for layers.  Our AGOL item being referenced is a secured service with many sublayers.  Would we have to add some sort of sublayer number?

 

 

"applicationProperties": {
        "viewing": {
            "search": {
                "enabled": true,
                "disablePlaceFinder": true,
                "hintText": "ID",
                "layers": [
                    {
                        "id": "Asssets2_9498",
                        "field": {
                            "name": "OBJECTID",
                            "exactMatch": true,
                            "type": "esriFieldTypeOid"
                        }
                    }
                ],
                "tables": []
            }
        }
    },