Republished choice updates do not appear in feature layer

1283
23
04-12-2017 12:48 AM
vanessagiles
New Contributor III

I edited the choices to an existing survey and republished it successfully however these changes are not reflected in the feature layer in arcgis online.  What else do I need to do to see this change? (urgent!!)   The changes are available in the app but not online.

0 Kudos
23 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Vanessa,

Survey123 Connect does not currently update the domain when republishing surveys. This is partially because if values have been entered that have been subsequently removed, those would not be displayed.  As a workaround, you can manually update the domain with the values; see Updating Hosted Feature Services in ArcGIS Online | ArcGIS Blog  

vanessagiles
New Contributor III

Thanks very, James, this seems like the right answer however I am unable to save the changes.  I have only changed the choices options for one list but cannot update the service:

 

0 Kudos
vanessagiles
New Contributor III

T

Invalid Definition

Thanks very, James, this seems like the right answer however I am unable to save the changes.  I have only changed the choices options for one list but cannot update the service - please see error message. 

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Can you provide a copy of the UpdateLayerDefinition text?  JSON is highly structured format that is easy to get a bit wrong.  you can also try validating at http://jsonlint.com - it's good for checking that the text is valid.

0 Kudos
vanessagiles
New Contributor III

This is the section that I have updated but the errors seem to be from existing code. I changed the code for "Unsure" and added "Mauve".  The code saves ok but then if I try adding new point data Mauve is still not showing as an option.

    {
      "name" : "bandLT",
      "type" : "esriFieldTypeString",
      "alias" : "Band colour - LEFT TOP",
      "sqlType" : "sqlTypeOther",
      "length" : 4,
      "nullable" : true,
      "editable" : true,
      "visible" : true,
      "domain" :
      {
        "type" : "codedValue",
        "name" : "cvd_bandLT",
        "codedValues" : [
          {
            "name" : "Make Selection",
            "code" : "ms"
          },
          {
            "name" : "Unsure",
            "code" : "Un"
          },
          {
            "name" : "Black N",
            "code" : "N"
          },
          {
            "name" : "Orange O",
            "code" : "O"
          },
          {
            "name" : "Green P",
            "code" : "P"
          },
          {
            "name" : "Mauve U",
            "code" : "U"
          },
          {
            "name" : "Yellow Y",
            "code" : "Y"
          },
          {
            "name" : "White W",
            "code" : "W"
          },
          {
            "name" : "Blue B",
            "code" : "B"
          },
          {
            "name" : "Red R",
            "code" : "R"
          },
          {
            "name" : "Pink K",
            "code" : "K"
          },
          {
            "name" : "Metal M",
            "code" : "M"
          },
          {
            "name" : "Wild (unbanded)",
            "code" : "Wild"
          }
        ]
      },
      "defaultValue" : null
    },

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Yes, the JSON looks good.  You can remove the other parts of the Service definition - the UpdateLayerDefinition requests only really needs what has changed (deletion of items looks more like changing to blank values)

0 Kudos
vanessagiles
New Contributor III

Sorry I don't understand.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

My apologies, I may have mis-read the above comment.  Did the update save correctly?  You say it saves okay, but then mention the other areas presenting errors.  If it still isn't submitting successfully, you can reduce the amount of text being submitted to just:

{
"fields" : [
{
"name" : "<FIELDNAME>",
"domain" :
<YOUR DOMAIN INFORMATION>
]
},
"defaultValue" : null
}
]
}

As opposed to the full definition

vanessagiles
New Contributor III

The changes in code looked to be saving but I just closed out of the update tab and re-opened and the have not been saved, presumeably due to the other two error messages that appear (pre-existing).  I will try and update using only the section of code relating to that choice list. 

0 Kudos