Select to view content in your preferred language

Enable ObjectID field for Find Locations and web map url parameters

4099
8
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

8 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": []
            }
        }
    },

 

 

 

ChelseaRozek
MVP Regular Contributor

@ArmstKP Even though we edited the JSON of our webmap to use the ObjectID, it didn't change what it field it says is searchable in the webmap's settings page, though it does work to search by the ObjectID. To make sure you have the correct layer ID string, I would first set another field on that layer to be searchable via the settings page and then just tweak the JSON to say ObjectID instead of that field's name and change the type to esriFieldTypeOid.

0 Kudos