Include related data from origin table in survey123 report

381
4
12-10-2021 12:30 PM
StaceyHenk
New Contributor II

I have a survey that is used to perform inspections on outfall structures.  The setup is a one to many relationship, with one outfall for numerous inspection.  I am hoping to use the Survey123 reporting tool, but need to figure out if it's possible to pull information from the parent/origin data (the outfall) to the inspection report.  

I attempted to do this following the information in the 'repeats' section of this page https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereporttemplates.htm however this outputs data from ALL  of the outfalls, not just the one the inspection pertains to.  I figured something like this might work but haven't had luck 

${#Outfall} ${if (${ID} == ${Inspection.OutfallID}}) ${LocDesc} ${/}    ${/Outfall}

0 Kudos
4 Replies
ZhifangWang
Esri Regular Contributor

Hi @StaceyHenk , 

This looks a similar case to https://community.esri.com/t5/arcgis-survey123-questions/include-related-records-in-feature-report/m... . 

  • If you iterate from the child layer,
    • ${#inspections}
      Fetch attribute of the parent outfall: ${Outfall.field1}
      ${/}
  • If you want to iterate all inspections of an outfall
    • ${#Outfall}
      (The data context is already a specific outfall)
      ${#inspections}
      This is an inspection of ${Outfall.outfallName} on ${inspectionDate}
      ${/}
      ${/}
0 Kudos
StaceyHenk
New Contributor II

Thanks for the response!  I tested out:

 ${#Outfall} ${Outfall.LOCDESC} ${/}

It returns the LOCDESC of all outfalls in the parent feature class, not just the LOCDESC of the current report.  Is there something I need to add so that it only grabs the LOCDESC of the active GlobalID or ObjectID?

0 Kudos
StaceyHenk
New Contributor II

I also tried:

${#Inspection} ${Outfall.LOCDESC} ${/}

and received an error:

Error: An error occurred when checking the report template. Failed to parse ${Outfall.LOCDESC} since LOCDESC cannot be found in the current parsing scope.

0 Kudos
JJ_Reyes
Occasional Contributor

@StaceyHenk - Did you ever get this working?

0 Kudos