[JSON] Converting open ended field to fixed un-editable drop down menu field.

1393
2
03-22-2016 10:01 AM
ArlanHenry
New Contributor III

I've created a geoform web app using ArcGIS Online which requires users to rate the severity of a problem from 1 - 5 and then locate the problem area on a web map.

PROBLEM:

The field where the score goes remains blank while it waits for the user to actually input the score with their keyboard. This basically resorts to relying on the honour system for user input.

JSON snippet

     {

     "name": "Severity",

      "type": "esriFieldTypeInteger",

      "alias": "Severity Index",

      "sqlType": "sqlTypeInteger",

      "nullable": false,

      "editable": true,

      "domain": null,

      "defaultValue": null

    },

I need to recode this section in order to control the user input by providing them with a drop down menu containing these values:

1 - Beginning of asphalt damage (barely noticeable)

2 - Minor inconvenience

3 - Deceptively deep (Puddle forming)

4 - Whoa! (Muh R@$$Ҥoⱡⱻ)

5 - Detrimental to vehicle suspension, traffic, safety, and health

Thank you in advance for your assistance.

If you need to see the entire JSON script then I'm willing to share it.

0 Kudos
2 Replies
RickeyFight
MVP Regular Contributor

Can you use domains to control user input?

0 Kudos
ArlanHenry
New Contributor III

I should have been more specific.

I want to create a domain to control user input. That would require some

knowledge of JSON or for me to use ArcGIS Pro (or ArcMap) rather than

ArcGIS online.

This is what I came up with, but it was rife with parse errors.

{

"name" : "Severity",

"type" : "esriFieldTypeString",

"alias" : "Severity Index",

"sqlType" : "sqlTypeOther", "length" : 140,

"nullable" : true,

"editable" : true,

"domain" :

{

"type"": "codedValue",

"name" : "dSeverity"

"codedValues" : [

{

"name" : "Beginning of asphalt damage (barely noticeable)",

"code" : "1"

},

{

"name" : "Minor Inconvenience",

"code" : "2"

},

{

"name" : "Deceptively Deep (puddles)",

"code" : "3"

},

{

"name" : "WHOA! (Muh R@$$Ҥoⱡⱻ)",

"code" : "4"

},

{

"name" : "Detrimental to vehicle suspension, traffic, safety, and health",

"code" : "5"

}

]

},

"defaultValue" : null

},

0 Kudos