I'm familiar with creating or enabling attachments for a feature class or table in ArcCatalog and ArcGIS Online. Is there a way to have several feature classes in a FGDB relate to a single attachment table using one:many relationships between each feature class and the one attachment table? I've tried the following, which didn't work:
I was hoping to lump all photos from all the feature classes into a single attachment table instead of the 9-10 attachment tables for the FGDB.
Using a GUID as the relate key can be tricky business. If the data is collected in geodatabase and then moved into another gdb, those guids get changed. My suggestion is to add another fieild and name it something like RelateID or JoinID. You make it a text fields of 255 characters and then calulate it's value of the original GUID. That value is a static snapshot so it persists regardless of where the data ends up living. Create your subsequent relationship classes based on this field.
Like so many things in life there is a trade of when using this procedure. It's up to you to you to add new relate field values when records are added....
Thanks for the suggestion on preserving the GUID. Whether I use GUID or another relate field, I still cannot seem to create a single table that will accept attachments, photos in my case, from multiple feature classes (FC). I have 5 FCs that need to have attachments. Instead of creating an attachment table for each FC, I want to have a single attachment table and relate all the FCs to the table via one:many relationships. When I create the relationships, ArcMap, ArcGIS Pro, and ArcGIS Online do not recognize the table as an attachment table. When I use the 'create attachments' feature in ArcCatalog, I can attach files to a single FC.
Hmmm.... That's interesting. All of it.
Re-thinking my earlier suggestion, I think you will need a series of 5 different relate fields in your attachment table:
FC1_Relate, FC2_Relate, FC3_Relate, FC4_Relate, FC5_Relate
In each of your 5 feature classes, you'll just have one relate field (aka the 'Key' field).
How do you 'create attachments' feature in ArcCatalog' ? Looking at An overview of the Attachments toolset—Help | ArcGIS for Desktop , I don't see such a tool and the help makes me wonder if you'll actualy be able to accomplish your goal of one attachment table with mulitple feature classes.
To create attachments in ArcCatalog, right click the FC in ArcCatalog>>Manage>>Create attachments. It creates the [parent name]_ATTACH table and [parent name]_ATTACHREL relationship. The graphic shows attachment tables/relationships created for tables.
By default, the _ATTACH table contains the following fields where the REL_GLOBALID field is used to relate to the parent GlobalID:
One way I tried was to create relationship classes between each FC and the one _ATTACH table that I had ArcCatalog create for FC0 so:
That didn't work in the sense that the table would show up in ArcMap, ArcGIS Online, and Collector for ArcGIS but I couldn't add any attachments except for FC0.
Another way I tried was to add GUID fields to the FC0_ATTACH table for every FC I wanted to relate, which sounds like what you suggested earlier.
That approach yielded the same results as the first approach.
To add to the confusion of how ESRI handles attachments. I used ArcCatalog to auto create attachments for an Assessment FC, which gave me:
I looked at the Relates property for Assessment FC in ArcMap and could not see the _ATTACHREL relationship listed; however, I could still add attachments. The relationship shown in the graphic below is for another table and not for the Attachment table.
Then I manually created a relationship between a Camera FC (in the same FGDB as Assessment) to the Assessment_ATTACH table using parent GlobalID to child REL_GLOBALID. Since the Assessment_ATTACH relationship works for Assessment FC, I thought I could hitch the Camera FC to the same attachment table and inherit all the attachment capabilities afforded the Assessment FC. Wrong! I could still add attachments for the Assessment FC, but not for the Camera FC. I look at the relate properties for the Camera FC and the relationship I created between Camera FC:Assessment_ATTACH is in the list.
It makes me wonder if there is something going on behind the scenes to make the attachment relationships work that isn't exposed to the user. Also wonder if a personal GDB would treat attachments differently seeing as how it follows the Access database schema. A rabbit hole for another day. For now, I'll do it the ESRI way and create attachments for every FC/table that needs it.