Select to view content in your preferred language

how to relate two feature layers in AGOL

1445
2
Jump to solution
02-17-2023 09:14 AM
Sajjid_Budhwani
Emerging Contributor

Hello,

I would like to relate my polygon feature layer with the the point feature layer (one-to-one relationship). Is there a way I can do that in the ArcGIS Online platform? I need this in order to configure the District Lookup widget in my web app builder.

Thanks in advance for your suggestion(s).

 

0 Kudos
1 Solution

Accepted Solutions
MobiusSnake
MVP Regular Contributor

The two layers need to be part of the same hosted feature service.  There are a few ways to do this, here's one:

  • Export your two layers as File Geodatabases and download these GDBs
  • In ArcGIS Pro, create a new File GDB and copy/paste the two layers into the new GDB
  • Make sure the origin class has a Global ID
  • Add a GUID field to the destination class named something like "parentid"
  • Create a relationship class between the two, with 1:1 cardinality
  • Close Pro, zip the File GDB, upload it to AGOL and create a new hosted feature layer from it

Edit - If you need to create relationships on existing data, the easiest way to do it would be before the final step above.  How those relationships get created depends on your data, though.

View solution in original post

0 Kudos
2 Replies
MobiusSnake
MVP Regular Contributor

The two layers need to be part of the same hosted feature service.  There are a few ways to do this, here's one:

  • Export your two layers as File Geodatabases and download these GDBs
  • In ArcGIS Pro, create a new File GDB and copy/paste the two layers into the new GDB
  • Make sure the origin class has a Global ID
  • Add a GUID field to the destination class named something like "parentid"
  • Create a relationship class between the two, with 1:1 cardinality
  • Close Pro, zip the File GDB, upload it to AGOL and create a new hosted feature layer from it

Edit - If you need to create relationships on existing data, the easiest way to do it would be before the final step above.  How those relationships get created depends on your data, though.

0 Kudos
Sajjid_Budhwani
Emerging Contributor

thank you!

0 Kudos