Related tables and offline use in Collector. How to setup?

4216
2
Jump to solution
05-21-2016 02:06 PM
SveinungRaheim
Occasional Contributor

I try to setup a feature service for offline use with collector for arcgis.
I want to make an inspection table that I can edit in the field.

The table and the feature service has to attributes that I want to use for the relationship. These two attributes are maintained outside this database.

I use ArcGIS server 10.4 and Sql-server express 2012.

From this blogpost: Related Tables – Exploring New Ways to use Collector for ArcGIS | ArcGIS Blog

and this help page: Prepare data for offline use—Documentation | ArcGIS for Server

it seems that you have to use globalID in the relationship to get it work off line. But if I have a feature class with GlobalID and a table with a globalID and make a relationship between those to GlobalID, I will not get any matching records! Thats logical and I have tested it in ArcMap. Iam able to make new rows in the related table, but there is no matches afterwards.
So my question is:

How do I establish this join/relation? For me, it seems logical to use GlobalID in the featureclass to something else in the table. But what? I tried to make a ordinary text field. That did not work. I found this topic tonight:

ArcGIS collector and related table - Geographic Information Systems Stack Exchange

That suggest to use a GUID-field in the table. Is that the solution?

1 Solution

Accepted Solutions
SveinungRaheim
Occasional Contributor

Thanks for the reply Panagiotis.

After some tries and some help from ESRI support in Norway (Geodata AS) I succeded.

What I had to do?

  1. Add global ID to the parent dataset.
  2. Add global ID to the stand-alone table I was going to make the relate to.
  3. Add a GUID-field in the stand-alone table.
  4. Create a relationship-class. Here I choose to make a simple peer-to-peer class. Primary key is GlobalID, forein-key is the GUID-field in the standalone table. I made a 1-M connection.
  5. I have a sql-server express database, so no versioning is available. Thus I had to enable archiving in both datasets.
  6. When publishing, the relate-table has to be part of the MXD. As long as all the previous conditions are med, this wont generate any errors.
  7. Publish the service with all options enabled (create, update, delete etc).
  8. When adding the service to the webmap, the whole service must be added. This includes the relate-table. The web app builder and collector will now recognize the relate table.
  9. To controll what to edit in collector, do that in the pop-up-dialog. If you only want to make it possible to edit the relate table (i.e. accurate dataset where you only want to add status to the parent dataset).

Good luck! Its fairly easy if you know what to do....

Sveinung Bertnes Råheim

Bodø, Norway

View solution in original post

2 Replies
PanagiotisPapadopoulos
Esri Regular Contributor

Yes on the related table the field must be GUID. This enable the add related record functionality. See below.

Capture.PNG

SveinungRaheim
Occasional Contributor

Thanks for the reply Panagiotis.

After some tries and some help from ESRI support in Norway (Geodata AS) I succeded.

What I had to do?

  1. Add global ID to the parent dataset.
  2. Add global ID to the stand-alone table I was going to make the relate to.
  3. Add a GUID-field in the stand-alone table.
  4. Create a relationship-class. Here I choose to make a simple peer-to-peer class. Primary key is GlobalID, forein-key is the GUID-field in the standalone table. I made a 1-M connection.
  5. I have a sql-server express database, so no versioning is available. Thus I had to enable archiving in both datasets.
  6. When publishing, the relate-table has to be part of the MXD. As long as all the previous conditions are med, this wont generate any errors.
  7. Publish the service with all options enabled (create, update, delete etc).
  8. When adding the service to the webmap, the whole service must be added. This includes the relate-table. The web app builder and collector will now recognize the relate table.
  9. To controll what to edit in collector, do that in the pop-up-dialog. If you only want to make it possible to edit the relate table (i.e. accurate dataset where you only want to add status to the parent dataset).

Good luck! Its fairly easy if you know what to do....

Sveinung Bertnes Råheim

Bodø, Norway