Hi, how i can get information fron the data base and consume in my collector.

413
1
08-29-2017 01:18 PM
PriscilaSamaniego
New Contributor II

Hi, how i can get information fron the data base and consume in my collector. For example  I am registering the maintenance of the streets, I click on the road I add a new maintenance (bache) and in the data entry I have a responsible team field (Team 1, Team 2, Team 3) which I show in a list using domains. But I want these lists to be filled by getting information from the database, so if they create another work team it will be updated in my list of my collector for ArcGIS.

Thanks

0 Kudos
1 Reply
RandyBurton
MVP Alum

I hope I am understanding your question.

I don't believe that you can update a table and have it automatically update a domain. After updating a table, you can use the Table to Domain tool to create or update a domain. Depending on how your service is hosted, you will probably need to do some additional steps to push it to your crews.

For AGOL, you can update the JSON file associated with a feature service to add items to a field's domain.  See Updating Hosted Feature Services in ArcGIS Online (specifically the PDF article mentioned in the blog) for instructions.  Basically, you will be updating one field, and the section of the JSON would look something like this:

{
  "fields": [{

    "name": "roadCrew",
    "type": "esriFieldTypeString",
    "alias": "Road Crew",
    "sqlType": "sqlTypeOther",
    "length": 2,
    "nullable": false,
    "editable": true,
    "domain": {
      "type": "codedValue",
      "name": "crew",
      "codedValues": [{
        "name": "Team One",
        "code": "01"
      },
      {
        "name": "Team Two",
        "code": "02"
      }]
    },
      "defaultValue": null
    }]
}

Just add another item ("Team Three", for example) to the domain list:

{
  "fields": [{
    "name": "roadCrew",
    "type": "esriFieldTypeString",
    "alias": "Road Crew",
    "sqlType": "sqlTypeOther",
    "length": 2,
    "nullable": false,
    "editable": true,
    "domain": {
      "type": "codedValue",
      "name": "crew",
      "codedValues": [{
        "name": "Team One",
        "code": "01"
      },
      {
        "name": "Team Two",
        "code": "02"
      },
      {
        "name": "Team Three",
        "code": "03"
      }]
    },
      "defaultValue": null
    }]
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Use a service like jsonlint.com to validate your planned changes. Experiment with a backup or test service so you can work out any issues.  I also recommend not deleting items from a domain as that may cause unexpected issues.  Once updated, your crew will need to refresh their maps to see the changes.

I hope this helps.

0 Kudos