Select to view content in your preferred language

Carrying field values from parent fs across to related record table

749
3
Jump to solution
02-08-2024 10:33 PM
Labels (1)
ChrisH2
Regular Contributor

Hi, I'm seeking advice on how to carry values from the parent featureservice across to a related record table. In the example image below from this blog you can see what looks like Unit = TUU has been carried over from the parent and into the related table. I've used smart forms and calculated expressions a bit but aren't sure whether I try and leverage the relationships or if there is another way to define this via a calculated expression on the Unit field in the related table. 

 

In my case, this Unit value would  then define the options available in the Staffing and Owner fields via contingent values. The Unit field is also be a domain.

 

 

Form-Add-Related-Record-1.png

ArcGIS Enterprise 11.2 with hosted fs

The original blog was a little old so I'm guessing that I may not get a speedy reply if I post my question in the comments there

 

cheers

 

0 Kudos
1 Solution

Accepted Solutions
ChrisH2
Regular Contributor
I've solved this via the common calculated expressions for field maps  post 
ChrisH2_0-1707714538505.png

 

what initially took some time was determining the relationship name to use in FeatureSetByRelationshipName. After publishing the parent featureclass, the related table and the relationship to Portal, I couldn't see anywhere where the relationship class is explicitly referenced or named. 

 

In my case where I was applying an arcade expression against a field in the attribute table, the relationship name was actually the name of the parent polygon feature service. Hope this helps someone else

 

View solution in original post

3 Replies
ChrisH2
Regular Contributor
I've solved this via the common calculated expressions for field maps  post 
ChrisH2_0-1707714538505.png

 

what initially took some time was determining the relationship name to use in FeatureSetByRelationshipName. After publishing the parent featureclass, the related table and the relationship to Portal, I couldn't see anywhere where the relationship class is explicitly referenced or named. 

 

In my case where I was applying an arcade expression against a field in the attribute table, the relationship name was actually the name of the parent polygon feature service. Hope this helps someone else

 
FredericPoliart_EsriAU
Frequent Contributor

To carry values from a parent feature service to a related record table in ArcGIS Experience Builder, and subsequently use these values to define options available in other fields through contingent values, you have several approaches. Given your scenario and the tools available within ArcGIS Enterprise 11.2, here are some strategies you could consider:

1. Leveraging Relationships and Attribute Rules

  • Attribute Rules: These can automate the process of copying values from parent features to related records. You can create an Attribute Rule on the parent feature layer that triggers a script to copy the desired value (e.g., Unit) to the related record whenever a new related record is created or when specific attributes on the parent feature are updated.
  • Arcade Expressions: Use Arcade expressions within your Attribute Rule to define the logic for copying values. Arcade can access related records through the FeatureSetByRelationshipName function, allowing you to manipulate related data directly.

2. Smart Forms and Calculated Expressions

  • Smart Forms: Utilize smart forms in ArcGIS Experience Builder to create dynamic forms that change based on user input or pre-defined rules. You mentioned using smart forms and calculated expressions, which can be further tailored to include logic that references the parent feature's attributes.
  • Calculated Expressions: For the Unit field in the related table, you can create a calculated expression that references the parent feature's Unit value. This requires a bit of customization and understanding of how your data is structured in terms of relationships.

3. Contingent Values Based on Parent Feature

  • Contingent Values Setup: Once you have the Unit value carried over to the related record, you can use contingent values to define what options are available in the Staffing and Owner fields based on the Unit value. This involves setting up contingent value rules within your geodatabase or feature service that look at the Unit field to determine the available options for other fields.

4. Custom Scripting or Automation Tools

  • If the out-of-the-box tools do not fully meet your needs, consider developing a custom script or tool that listens for changes to the parent feature and updates related records accordingly. This could be done using Python scripts and the ArcGIS API for Python or ArcPy, especially if you're working within ArcGIS Enterprise.

5. Utilize Domain Values

  • Since the Unit field is a domain, ensure that the logic you implement respects the domain values when copying or referencing this field. Domains ensure data integrity and consistency, so your expressions or scripts should handle domain values correctly.

Additional Recommendations:

  • Documentation and Support: Check the latest ArcGIS documentation and community forums for updates or similar use cases. Since you're using ArcGIS Enterprise 11.2, ensure any guidance aligns with this version.
  • Esri Technical Support: For complex scenarios or to get assistance tailored to your specific setup, reaching out to Esri technical support can be beneficial.

Implementing this functionality will likely involve a combination of the strategies above, tailored to fit your specific data model and workflow requirements. Testing in a development environment before applying changes to your production system is also recommended to ensure the desired outcomes are achieved without impacting existing data or workflows.

ChrisH2
Regular Contributor

thanks @FredericPoliart_EsriAU . Often I find that significant research is required to narrow down the field of potential approaches, so your post is very much appreciated. At the moment it looks likes a combination of 1, 2 and 3 is working for me

 

My current issue is trying to get the smart forms to honour the "restrictive" setting that I have on my contingent values when I'm configuring it in Pro prior to publishing. This was working previously in the smart forms so I'm confused as to why it's changed and now allows users to choose any domain value now that it's published. I might have to start another post on that one unless it's a known bug!

0 Kudos