Select to view content in your preferred language

Including fields from parent record in report

465
4
05-31-2024 12:32 PM
michellekc
Emerging Contributor

Hi! I've created a survey for what is basically an inspection workflow. I need to run a report on the inspection table that references the site identification information in the related parent table. I've attempted following the instructions linked here, but it appears like those are deprecated: https://community.esri.com/t5/arcgis-survey123-questions/created-survey123-from-feature-layer-with-r...

I receive a parsing error when I try the format of ${ParentLayer.FieldNameinParentLayer}

michellekc_0-1717183834208.png

Is there a syntax fix to this? Thanks!

Tags (2)
0 Kudos
4 Replies
ChristopherCounsell
MVP Regular Contributor

I believe the survey needs to target all the layers that you want to reference in the report.

But you don't need to create the report from the actual survey.

You can create another survey form that targets the entire layer then generate the reports from this, instead of the survey that only targets the related table.

0 Kudos
abureaux
MVP Frequent Contributor

abureaux_0-1717432085064.png

This is a common error, and we cant really help without seeing the Feature Report, but maybe also the XLSX. What it's telling you is essentially "SITE_ID" is somewhere it shouldn't be. E.g., You referenced it inside a repeat when the actual item exists in the main feature layer. So something like: ${#some_repeat}${SITE_ID}${/} instead of just ${SITE_ID}

Again, there are a bunch of different configurations that could result in this, and listing all of them isn't practical.

You can only reference an item within the feature layer that it exists in. All surveys have a "main" feature layer. And all repeats are "related tables", which means they are technically different feature layers. There is one example though: You can use "dot notation" to pull something down a layer (e.g., from the main feature layer into a repeat).

0 Kudos
michellekc
Emerging Contributor

Thanks for your input! I've been trying out the dot notation. If my main feature is "DOEE_Wetland_Inventory" then {DOEE_Wetland_Inventory.SITE_ID} should theoretically work, right? I'm getting the same parsing error, so I feel like I'm doing something wrong still.

I've attached my xlsx and feature report template.

 

 

 

0 Kudos
abureaux
MVP Frequent Contributor

As I am on Enterprise, I cannot publish from Connect with capitals in the "name" column. So, I cannot test this myself unfortunately.

Here are a couple observations though:

  • Your Feature Report question "${DOEE_Wetland_Inventory.SITE_ID}" will not work because "SITE_ID" doesn't exist in the XLSX **
    abureaux_0-1717521372901.png
  • Check the Feature Layer name just to be safe. To do this: Go to the "Schema" tab > check the Feature Layer name under "Layers/Tables". In my case, assuming "SITE_ID" was in the XLSX, my dot notation would be something like "${Wetland_Assessment.SITE_ID}"
    abureaux_1-1717521528951.png
  • You only need to use dot notation when you are pulling something down a layer (e.g., From the main Feature Layer Wetland_Assessment into a repeat such as Vegetation_Profile). However, your SITE_ID reference (i.e., ${DOEE_Wetland_Inventory.SITE_ID}) is the very first thing in your Feature Report (and also not nested in any other tags). This has a few implications, so my first question would be "what layer is SITE_ID in?". Please note that you cannot pull something up a layer (e.g., from a repeat such as Vegetation_Profile into the main Feature Layer of Wetland_Assessment) this way.
  • You may wish to make list_combined_plants an External Select (CSV) as it is a very large list (>500 items)
  • "note" question types do not require a name. Adding a name to a note will result in that note being added to your Feature Layer unnecessarily.
  • Your XLSForm is outdated.

** EDIT: I am kind of making an assumption here... technically, you could have published this Feature Layer from ArcPro and then chose to omit "SITE_ID", or you could have published from Connect and then later deleted "SITE_ID" from the XLSX. In both of those cases, SITE_ID would actually exist in the Feature Layer

0 Kudos