Coded values show up not description

1784
13
Jump to solution
09-10-2018 06:26 AM
jaykapalczynski
Frequent Contributor

I created a FC and added Domains to it.  I coded them as such

0     Fallen tree

1     Water Backup

When I go into Collector App and bring up the webmap then user starts to edit

Th edit window shows the symbology for each of the selections BUT it shows the 0 and 1 and not the description.

This also appears in the web map while editing....

How do I get the description to show up 

0 Kudos
1 Solution

Accepted Solutions
jaykapalczynski
Frequent Contributor

With help of another employee here....figured out the root of the problem....So we figured out a way to fix it early enough that we do not have to update the JSON file after it has been published to ArcGIS Server.

It turns out that when you create a Feature Class with domains the Feature Template table (?) is not updated with teh domain values.  If you start and stop an edit session on that Feature Class in ArcMap before you publish the Template tables are updated with the Description from the Domain.

  1. So Create Feature Class
  2. Create and update fields with the Domain options
  3. Start Edit session (you don have to edit anything or add anything, simply start the edit session )
  4. End Edit session 
  5. Publish to ArcGIS Server

This fixed the issue for us....if you have any questions please ask....hope that I explained this well enough.

View solution in original post

0 Kudos
13 Replies
RandyBurton
MVP Regular Contributor

I've run into the same issue, as have others.  My workaround is posted in this thread: Domains do not appear in Collector after updating in AGOL.  It involves correcting the types section of the layer's json file.  The id should be the coded value and the name should be the description.  Hope this helps.

0 Kudos
jaykapalczynski
Frequent Contributor

OK I read the other post and I am sort of following.

1. How and where do I get the jSON file from my ArcServer Map Service (Data is served up locally to AGOL)

2. I assume I would have to do this each time I republish the Map Service from my mxd, for instance if there is a schema change etc.

3. I didn't read in there what you were actually changing in the jSON file...Think you mentioned updated via the Rest API...how do I do this

Thanks for your thoughts and help

0 Kudos
RandyBurton
MVP Regular Contributor

I use AGOL, so the navigation might be a little different with Server.

I log into my account and go to the Content section and select the Feature Layer in question.

On the Overview tab, in the Layer's section, click on the layer name (or click the Service URL).

Near the top of the next page, there will be a link for the JSON that will take you to the json data.  With AGOL it looks like this:

Rest Services

Near the bottom of the json, there is a section called types.  You should see something like:

  "types" : [
    {
      "id" : "0", 
      "name" : "0", 
      "domains" : 
      {
        "FieldName" : {"type" : "inherited"} 
      }, 
      "templates" : [
        {
          "name" : "0", 
          "description" : "", 
          "drawingTool" : "esriFeatureEditToolPoint", 
          "prototype" : {
            "attributes" : {
              "FieldName" : "0"
            }
          }
        }
      ]
    }, 
    {
      "id" : "1", 
      "name" : "1", 
      "domains" : 
      {
        "FieldName" : {"type" : "inherited"} 
      }, 
      "templates" : [
        {
          "name" : "1", 
          "description" : "", 
          "drawingTool" : "esriFeatureEditToolPoint", 
          "prototype" : {
            "attributes" : {
              "FieldName" : "1"
            }
          }
        }
      ]
    },
    {
    ... etc ...
    } 
  ],

You can copy the section and edit it in something like notepad.  You will need to add the description where it says 'name' (lines 4, 11, 24, 31, etc.) to the file by replacing the code value like this:

  "types" : [
    {
      "id" : "0", 
      "name" : "Fallen tree", 
      "domains" : 
      {
        "FieldName" : {"type" : "inherited"} 
      }, 
      "templates" : [
        {
          "name" : "Fallen tree", 
          "description" : "", 
          "drawingTool" : "esriFeatureEditToolPoint", 
          "prototype" : {
            "attributes" : {
              "FieldName" : "0"
            }
          }
        }
      ]
    }, 
    {
      "id" : "1", 
      "name" : "Water Backup", 
      "domains" : 
      {
        "FieldName" : {"type" : "inherited"} 
      }, 
      "templates" : [
        {
          "name" : "Water Backup", 
          "description" : "", 
          "drawingTool" : "esriFeatureEditToolPoint", 
          "prototype" : {
            "attributes" : {
              "FieldName" : "1"
            }
          }
        }
      ]
    },
    {
    ... etc ...
    } 
  ],

Start the whole types section with an opening { and drop the comma after the last square bracket and close with a }.  Check it for valid json with jsonlint.com.  If it checks, you can go into the admin section and update the json file.

For AGOL the admin address looks something like ('admin' between rest and services):

https : // services.arcgis.com/<xxxyyyzzz>/arcgis/rest/admin/services/<feature>/FeatureServer/0

I would practice this on a test copy of your feature and have a backup copy of your feature until you are comfortable with the process.   Let me know if you have additional questions.

I have also reported this issue to ESRI.  Perhaps they will have a better solution.

0 Kudos
jaykapalczynski
Frequent Contributor

In ArcGIS Server Manager I was able to click here to see the JSON

I can identify the area that needs to be updated.  "name": "0";

,
 "types": [
  {
   "id": "0",
   "name": "0",
   "domains": {
    "PubPriv": {"type": "inherited"},
    "Item": {"type": "inherited"}
   },
   "templates": [
    {
     "name": "0",
     "description": "",
     "prototype": {
      "attributes": {
       "Comments": null,
       "Case_": null,
       "PubPriv": null,
       "Item": "0"
      }
     },
     "drawingTool": "esriFeatureEditToolPoint"
    }
   ]

QUESTIONS:

1. My question is where and how do I do this from ArcGIS Server?  

2. I can see what needs to be changed but have NO idea where to physically modify the json file.  

3. I assume that once I do this I will have to do this every time the service is updated/overwritten because the error in the json file is coming from the publishing to the rest endpoint

0 Kudos
jaykapalczynski
Frequent Contributor

Looks like I am not in the Administration Directory...  How do I get there?

0 Kudos
jaykapalczynski
Frequent Contributor

OK I added admin to my URL to get to the admin section

Was this

http://services.arcgis.com/xxxx/arcgis/rest/services/Layername/FeatureServer/0

Now this

http://services.arcgis.com/xxxx/arcgis/rest/admin/services/Layername/FeatureServer/0 

That gets me here

I click Update Definition and I dont get anything in the box. I assume the entire JSON would be there to make edits to

0 Kudos
RandyBurton
MVP Regular Contributor

On my screen, I have a link to 'All Layers and Tables' and a link to each layer between supported query formats and description.  I would then select a layer and edit its json data.  So, I'm not quite sure how your service is being hosted.

0 Kudos
RandyBurton
MVP Regular Contributor

For your photo of "Points of Interest (ID: 0)", what is the basic format of this page's web address?  I think the admin page for this layer is where you need to be.

0 Kudos
RandyBurton
MVP Regular Contributor

I tend to look at the json file first because I've become used to working with it.  But there are always a number of ways to do the same thing.  Here's another option for you to try.

On the "Add Features" screen of your original post, there should be a manage button at the bottom of the screen.  Click it.

The screen will show "Manage New Features" that will look something like this:

Manage Screen

Click the diamond to the right of each number and select Properties.

For Label, Name and Description, replace the number with the description for the number (domain code) and click done.

When you have gone through the list, click "Save Changes".  This should update the layer's json file.

0 Kudos