Select to view content in your preferred language

Changing Feature Type resets values in other fields

7896
15
Jump to solution
06-24-2014 01:33 PM
RandyBurton
MVP Alum
I have noticed that Collector will reset some fields that use a domain value but not others when the field that is used to set the symbol (feature type). Collector will give a warning message about �??Changing Feature Type.�?�  If yes is selected then those fields to the left (in the original geodatabase field order) that use a domain look-up value are reset; those using domain look-up values to the right are unchanged. Changing the field order of the form will not change which fields are reset.  This is the behavior in both iOS and Android.

A similar issue was described in the forum about two years ago.

Has anyone found a solution?
Tags (2)
0 Kudos
15 Replies
RoyceSimpson
Frequent Contributor

I'm having this issue as well and have no idea how to fix it.  When I change a particular coded domain value for a feature I get this popup "changing feature type - You are changing the feature type, which may potentially overwrite some field values.  Are you sure you want to do this?"

Yes, I'm sure, every time I'm sure.  

How do I fix this.  My field workers are about ready to kill me.

-r

0 Kudos
RandyBurton
MVP Alum

If you are using AGOL, I suggest editing the types section of the feature layer's json file using the REST API.  Here's a sample of the layer's type section.

{
  "types": [
  {
    "id": "1",
    "name": "Red",
    "domains": {
      "Color": {
        "type": "inherited"
      },
      "Field2": {
        "type": "inherited"
      },
      "Field3": {
        "type": "inherited"
      }
    },
    "templates": [{
      "name": "Red",
      "description": "",
      "drawingTool": "esriFeatureEditToolPoint",
      "prototype": {
        "attributes": {
          "Field2": 0,
          "Color": "1",
          "Notes": null,
          "Field3": "AB"
        }
      }
    }]
  },
  {
    "id": "2",
    "name": "Blue",
    "domains": {
      "Color": {
        "type": "inherited"
      },
      "Field2": {
        "type": "inherited"
      },
      "Field3": {
        "type": "inherited"
      }
    },
    "templates": [{
      "name": "Blue",
      "description": "",
      "drawingTool": "esriFeatureEditToolPoint",
      "prototype": {
        "attributes": {
          "Field2": 0,
          "Color": "2",
          "Notes": null,
          "Field3": "CD"
        }
      }
    }]
  }]
}

In this example there are two types, Red and Blue, which will be used to symbolize the layer.  Setting the Color domain to "1" will set the symbol to a red dot; setting it to "2" will select a blue dot.  The settings in the prototype section will also set Field2 and Field3's domain to the indicated default values.

The "Notes" field is a text field and is set to null -- that is, if the field does not currently have a value.  If it has a value, it will be inherited -- that is, it will remain unchanged.

What you will need to do is to set Field2 and Field3 to null so they will also be inherited.  For example:

        "attributes": {
          "Field2": null,
          "Color": "2",
          "Notes": null,
          "Field3": null
         }

The domain Color will retain its value, otherwise changing type would not change the symbol on the map.  If Field3 had the value "XY", it would retain the value "XY" when the Color domain is changed.

I do recommend that one type group retain all the default domain settings so that when new features are added, they will set  domains properly.  You do not want null values for your domain's codes.

This setting should prevent the warning message about changing feature types, unless changing to the default per my recommendation.  I also highly recommend that you work with a copy of layer and experiment with it.  Back up your layer before making any changes.

This blog Updating Hosted Feature Services in ArcGIS Online links to a PDF that explains the specifics of editing a json file.

0 Kudos
RoyceSimpson
Frequent Contributor

Thanks Randy.  We stand up new feature services all the time for this particular system... would I have to go in and manually do your changes every time?  If so, that's not realistic workflow.  

Conversely, what can I do to prep the data in the mxd so that I can make that message NOT come up in Collector?  I have other editable Collector maps that don't have that message.  I'm not sure what the difference is between those maps.  I follow pretty much the same mxd -> publish process every time.

-Royce

0 Kudos
RandyBurton
MVP Alum

Royce, I agree that manually doing changes is not a very productive workflow.  I have not found a way to do this consistently in the mxd prep.  Many of my features are similar; that is, they will have the same field definition and domain used for the symbology.  For the ones that are alike, I will copy the types section of one feature and use it (just the types section) to update another feature.

I will also use a python script to retrieve the types section from a hosted feature, sort the types based on ID and then update the feature.  It seems that when I set up the symbology in ArcMap, the settings get lost in the publishing process.  A python script could also set fields so the value would be inherited.  This would assist in the workflow.

0 Kudos
RoyceSimpson
Frequent Contributor

I guess I'm confused about some terminology here, specifically "feature type".  For my process, I bring a point feature class into ArcMap, symbolize it on "unique values" and publish that as a feature service.  I'm not using subtypes or any complex edit templates or any of that.  Just points symbolized based on a field value.  I've never had this issue before in Collector so why now, every time I change the domain value for this one field, I get that popup.  I'm just confused as to why this is even happening.  If I could, I might be able to change something in the mxd to remove the issue altogether.

0 Kudos
RandyBurton
MVP Alum

Perhaps you could provide a bit more description of: 1) the field you are symbolizing and the unique values allowed, and 2) the field and domain you are experiencing problems with.  From your description so far, I am assuming these are two different fields. 

For the field that I symbolize, I use a domain that lists and limits the unique values allowed.  I will also set the symbology up so that if any value not in the domain is used (in ArcMap <all other values>) the point feature will also display in Collector.  The domain provides the field crew with a dropdown list of specific choices.

Regarding "feature type", this does not refer to a subtype in this case.  The feature type can be a residential building vs a commercial building.  If the type is "residential", use a red dot; if "commercial", use a blue dot.  If it happens to be anything else, use a yellow one.  "Residential" and "commercial" (or their code value) would be unique value used in the field that you are using to symbolize.

For the fields you are having trouble with, you might look at the default value that the field will be populated with.  Also look  at "allow nulls".  Then compare these settings with other fields or features that are not causing issues.

0 Kudos