Select to view content in your preferred language

One to many features with forms

1236
10
Jump to solution
10-31-2023 08:17 AM
Labels (3)
KristalWalsh
Occasional Contributor II

Currently customer info (point hosted feature layer) is entered, property boundaries created (polygon hosted FL) and the customer number (an auto-sequence id) is pulled by a spatial intersect in AGO.  These two geometries are both related to the same propertyinfo table but was changed from a feature:feature relationship because this relationship type will not work in forms per this blog https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/introducing-related-record-editing-i...

My set up works okay for the first customer but I need to be able to maintain/ "pull" that customer id for subsequent properties that may be added for the same person? Creating additional customer points would duplicate customers and the auto-sequence arcade script renders the field not editable.  I would like for the customer info to be found via search of the map, then a new property feature added.  Without a feature-to-feature relationship, I'm not sure how to do this.  This portion of the workflow does not have to be completed in Field Maps but needs to be user friendly, hence the forms. I've attached my scratchpad ERD. Thank you so much for any assistance!!

Kristal Walsh, Florida Fish and Wildlife
Office of Conservation Planning
1 Solution

Accepted Solutions
bbollin
Esri Contributor

@KristalWalsh GlobalID and GUID is definitely the preferred method for a relationship as it is automatically populated and  user friendly or manually input IDs have the potential to break relationships if input incorrectly. I would still suggest having the Global/GUID as the relationship as this will be self managing if set up properly.

If you want to populate a user friendly identifier that is not a Parent Key/Foreign Key into related tables you may find this video helpful: https://community.esri.com/t5/esri-training-videos/using-calculated-expressions-with-related-records.... For related features, the FeatureSets intersection you previously mentioned works great

View solution in original post

0 Kudos
10 Replies
bbollin
Esri Contributor

Hi @KristalWalsh, we actually just released feature-to-feature relationship support in Map Viewer last week. Check this blog out: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/now-featuring-feature-to-feature-edi... 😀

KristalWalsh
Occasional Contributor II

No way!! LOL I haven't had time to check out the update because I've had my head buried in this. Man, this may be the 3rd time I've reconfigured this part of my workflow but better now than later. Thank you for bringing it to my attention!

Kristal Walsh, Florida Fish and Wildlife
Office of Conservation Planning
0 Kudos
KristalWalsh
Occasional Contributor II

@bbollin so if I change my relationship back to feature to feature, and select the first feature of one hosted feature layer (customer), is there a way I can create a new feature from the related hosted feature layer (property boundary) based on the selection of the first feature? I think I'm seeing the need for Arcade here somewhere but not sure how this would work.

Kristal Walsh, Florida Fish and Wildlife
Office of Conservation Planning
0 Kudos
bbollin
Esri Contributor

No problem! I went ahead and added in some notes to the original blog post to clarify 😊

To clarify your question on the dataset, are you wanting to populate a value that is not the relationship ID from a parent feature to a child feature?

0 Kudos
KristalWalsh
Occasional Contributor II

I think I'm actually back to square one on ids honestly this has been the vain of my existence since the UC.  You may be able to tell from the ERD attachment in the first post, that I have an auto-sequenced id (via Arcade and based on objectID +1) for the CustomerId field that is currently pulled into the PropertyBoundary layer through intersect.  I need to be able to make sure that the property records (both feature layer and property info table) are matched to the correct customer. I thought auto-sequencing was the way to go and then using featuresets by relationship to pull that id into the property layer but it won't handle subsequent properties accurately. I'm not sure now how this should be set up. I do have the global and GUIDs set up for field maps but I wanted a user-friendly id to relate the customer to properties. I hope this makes sense.

Kristal Walsh, Florida Fish and Wildlife
Office of Conservation Planning
0 Kudos
bbollin
Esri Contributor

@KristalWalsh, If I am following correctly that is possible but it will require some scripting on your part. You can Filter by RelationshipID to pull in similar attributes between related features and tables. However it will not initially show up when you begin creating the record as it doesn't exist quite yet, so there won't be anything to query. It should show up and populate the attribute on Update though.

KristalWalsh
Occasional Contributor II

Hi @bbollin I read the blog and yes, I understand now how this will work. Thank you, it took me a couple days to get back to this. My decision to populate a UID other than the GlobalID generated from the relationship was based on the complexity of the GlobalID, need for a simple UID for everyday use and having a back up plan if we end up having to move this to the enterprise environment at some point. There are comments about the GlobalID/GUID relationships being compromised or lost during a move or export. Not being very good at scripting, any suggestion on a simple way to make this happen is appreciated. I know others must be using user-friendly ids with related tables but I haven't found any info on that yet. Thank you!
 

Kristal Walsh, Florida Fish and Wildlife
Office of Conservation Planning
bbollin
Esri Contributor

@KristalWalsh GlobalID and GUID is definitely the preferred method for a relationship as it is automatically populated and  user friendly or manually input IDs have the potential to break relationships if input incorrectly. I would still suggest having the Global/GUID as the relationship as this will be self managing if set up properly.

If you want to populate a user friendly identifier that is not a Parent Key/Foreign Key into related tables you may find this video helpful: https://community.esri.com/t5/esri-training-videos/using-calculated-expressions-with-related-records.... For related features, the FeatureSets intersection you previously mentioned works great

0 Kudos
KristalWalsh
Occasional Contributor II

Thank you! I will check out the video but I was planning to populate a custom UID in addition to the system-generated Global ID/GUID and based on your filtering hint above, I think I will be able to make that happen with my custom ids. Paul Barker had helped me at the UC on a script to generate the sequence so I'm moving a little bit forward I think. Thank you so much! The feature-to-feature additions is also a huge step in the right direction. Have a great week. 

Kristal Walsh, Florida Fish and Wildlife
Office of Conservation Planning