Collector and Tables Relationship class

2762
22
07-30-2018 08:46 AM
SiranErysian2
New Contributor III

Related Tables in Collector: Spoke to Jeff Shaner and others at ESRI Conference 2018 and it was suggested that I use the Global ID field as the Primary key when joining a stand alone table with point feature class in map service published for Collector. Is this when the Global ID field is established? My table does not have a global id field. I have another field that I proposed to use that is in both the table and the feature class attributes. Why Global ID is suggested to use? Do I need to create a relationship between the table and the feature in the geodatabase for the table to appear in Collector?

0 Kudos
22 Replies
deleted-user-qpvAI3Fo0MKR
Occasional Contributor III

To answer your first question, if you publish your data to AGOL without a GlobalID, then a GlobalID is automatically generated. It is suggested as a primary key because it is system generated, is unique and 

In order for the related table to appear in Collector‌ your workflow should be:

  1. Create your feature class
    1. Use the Add GlobalIDs tool, ArcMap will handle this even if the feature class is empty.
  2. Create your related table, and include a text field called GUID
  3. Create your relationship between the feature class and the table, using GlobalID as the primary key on the FC and GUID as the foreign key on the table.
  4. Make sure both the FC and the table are present in your .mxd
  5. Publish to AGOL.
  6. Create your webmap, and then open it in Collector.

Feel free to PM me if you have any questions on this one.

0 Kudos
SiranErysian2
New Contributor III

Joshua,

Thanks you for your response. I have been working with your suggestions.

I posted some information on the Geonet site but I want to include more information and screen shots if possible.

I opened my map in AGOL and Collector and see my features. I see the related table

Clicking on a point in the map show the pop up.

Clicking on Show related Records

The related table has a field that is supposed to show the previous year’s measurements for each point record. There are more than 1 year that I wanted to show thus the 1 to Many relationship.

But there is nothing there. Also it is locked. Everything is shared.

It made sense to me when creating the relationship class that the feature was the origin table/feature class and the related table the destination. See below.

Should I switch them?

In Collector I see the related table at the bottom of the Details for a feature. There is View> but it is empty. This is where I would like my users to see the related historic information for the particular feature to compare with the data they will be collecting in the field. There is New> which has all the fields that are included in the feature class which was used to edit the information last year. So I would like to edit here and just have them view the related table with the information at the bottom of this list. However, when I click on the edit function to collect information on a point, I do not see the related table. I guess that’s Ok but where should the edits be captured? I have to strip the information from last year’s collection in the feature class every time and re-publish the map. At the user conference, I spoke with some of the Collector developers and they suggested just adding information in the related table. But some of that information will always be the same and I would make those fields not editable.

I hope this gives you some idea of what I’m trying to do. I hope you can continue to assist me.

Thank you.

Siran D. Erysian, M.A., GISP,

Research Analyst II – GIS

Think Spatially

Department of Water Resources

3374 E. Shields Ave, Rm. A-1, Fresno, CA 93726 (559) 230-3312

Siran.Erysian@water.ca.gov

0 Kudos
deleted-user-qpvAI3Fo0MKR
Occasional Contributor III

So the way the Relationship Class will work is this:

When you create a new record in the Related Table, the GUID will be populated with the GlobalID of the Feature it's related to.

The reason you aren't seeing any records when you click on the feature is because there are no records related to that feature until you create them.

If you're wanting to related existing records to the features, you'll need to create the relationships manually in ArcMap using GlobalID -> GUID, or, alternately, use some existing key(s) that relate the table to the features.

I'd suggest reading up a little on Relationship Classes before doing any more work.

0 Kudos
SiranErysian2
New Contributor III

Joshua,

I want to relate existing records to the features and I did use the Global ID and GUID in the relate as you saw in the screen capture. I want to see the existing records, not create new ones.

I am familiar with relationship classes and have done them several times successfully. Probably what I need to do is use a field that already exists in both the feature class and the related table so it will work. But everyone has so far suggested using the Global ID and the GUID which I had done manually in the mxd but there are no related records. It didn’t make sense to me to use those fields.

I’ll try another field and let you know the result.

Siran D. Erysian, M.A., GISP,

Research Analyst II – GIS

Think Spatially

Department of Water Resources

3374 E. Shields Ave, Rm. A-1, Fresno, CA 93726 (559) 230-3312

Siran.Erysian@water.ca.gov

0 Kudos
deleted-user-qpvAI3Fo0MKR
Occasional Contributor III

You're on the right track. They (I) were suggesting to use GlobalID and GUID as a best practice if you're starting from scratch. If you're using existing data, then the easiest route will be to use existing primary / foreign keys. I imagine you'll have success

0 Kudos
SiranErysian2
New Contributor III

That makes sense! Thanks. I’ll try again.

Siran D. Erysian, M.A., GISP,

Research Analyst II – GIS

Think Spatially

Department of Water Resources

3374 E. Shields Ave, Rm. A-1, Fresno, CA 93726 (559) 230-3312

Siran.Erysian@water.ca.gov

0 Kudos
SiranErysian2
New Contributor III

It didn't seem to work once I published my map again with the new relationship class on existing fields. Can't get related records to show from the related table when I click on the pop-up for the location.I don't even get a window with an error. I have Show Related Data checked in the configure pop-up. Do you have any other suggestions?

0 Kudos
deleted-user-qpvAI3Fo0MKR
Occasional Contributor III

Hmm. In ArcMap when you #identify on the point do you see the appropriate related record?

0 Kudos
SiranErysian2
New Contributor III

Yes it does. I related them manually. Editing feature and selecting a record in the feature and add selected to the relationship that appears. (Question: is there a more automated way to do this?)

I want the field crews to see historic information for the location. I created an expression from 3 fields (I’d like to get rid of the extra zeros but can’t figure out how to do that yet)

So republishing this feature service allows me to see the records in the AGOL map prepared for Collector. When I click on a point, I see Show related Records at the bottom and when I click on that link, I see the related that shows me the 3 dates where information is present.

What I don’t understand is when I click on Show in the Data Associated with Wells field I only get the most current record in a table window to the left no matter what field I click on

What is this table?

Thank you. You have been most helpful.

Siran D. Erysian, M.A., GISP,

Research Analyst II – GIS

Think Spatially

Department of Water Resources

3374 E. Shields Ave, Rm. A-1, Fresno, CA 93726 (559) 230-3312

Siran.Erysian@water.ca.gov

0 Kudos