Select to view content in your preferred language

Label child record with parent object ID

579
3
06-21-2023 05:23 AM
mshanaghan
Frequent Contributor

Is it possible to label a child record with the object ID of the parent record? I attempted to do this in Arcade, but the "FeatureSetByRelationshipName" function was unavailable for labelling purposes. 

I also tried creating a field in the survey123 connect xls form that would automatically populate with the parent object ID, but that failed too.

Does anyone know of any other ways to accomplish this?

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

You'd need to create a field and populate it somehow. You could use Arcade to run a field calculation, but you'd need to manually run that whenever you needed to update things.

You could also use Python to do the calculation, and then schedule a script / notebook to run regularly to keep the field up to date.

- Josh Carlson
Kendall County GIS
0 Kudos
MobiusSnake
MVP Regular Contributor

I've used Python (via a scheduled AGOL Notebook) for this.  The child records have a "parent_oid" field on them, along with a status field that's set to something like "New" when a record is submitted.  When the notebook kicks off it queries all "New" records, copies the OIDs over, performs some other enrichment, then sets the status up to "Live" or something similar, depending on the project.  Since it's only editing "New" records each run, it doesn't take much time (credits) to run.

Edit - Forgot to mention, also use hosted feature layer views with filters set to display only "Live" records for operational things like dashboards.  This way records pending processing don't show up.

0 Kudos
DevinCarlson
Occasional Contributor

Not sure if this helps your flow, but i have accomplished that by starting in Field Maps, selecting the parent feature.  Putting a text field in the pop up that has a URL linked to a S123 form.  In the URL, I used the example of :    arcgis-survey123://?itemID=location of survey form&field:GUID={GlobalID}&field:StructID={CULVERT_I}

The StructID is in the child record and the CULVERT_I is from the parent record.

I had to add a field in the child record and the S123 form to accept the parent information.  But this does work to pass parent information to the child record.  Which was important to me so that I could generate reports through S123 that included inspection information and parent information.

This is how I accomplished this, but my flow is for field inspections on an existing asset and conducting an inspection on that asset that is stored in a related table.

Good luck!

0 Kudos