Survey123 - URL Parameters/Populate Attributes

619
6
11-26-2019 02:34 PM
ElizabethHovsepian
New Contributor III

If I am doing a pole inspection in Survey123 and opening the survey by selecting the pole feature from another web app as well as populating attributes of the pole within the survey, is it possible to populate attributes of a feature that has a relationship/related table to the feature that is selected?  In example shown below, I would like to populate attributes not only from the pole, but from the transformer as well, such as phase, voltage, etc. Or if I was doing transformer inspections, populate attributes from transformer bank and transformer unit as well, etc. Make sense? 

Thanks,

Elizabeth

0 Kudos
6 Replies
DougBrowning
MVP Frequent Contributor

Did you try to access it using the {relationships/1/fieldname} syntax?  (Where 1 is the relationship number from the service)

If you go into the popup config then configure attributes link it will give you a list of all the related fields names so you can figure out the correct name to use.

0 Kudos
ElizabethHovsepian
New Contributor III

Hi,  thanks for your input. I tried what you suggested and it did not work.  I tried a url string with 2 features and also one with many features.  The only feature populating is the pole. Double checked that the naming convention is correct too. Here is the syntax:

arcgis-survey123://?itemID=c910f2c47e8a4af1a74c85a80807bacb&field:pole_number={FACILITYID}&field:oh_switch_number={relationships/3/FACILITYID}

0 Kudos
DougBrowning
MVP Frequent Contributor

Hmm that all looks right.  Is the field hidden or anything on form open?

0 Kudos
DougBrowning
MVP Frequent Contributor

Had another idea.  Is your relationship class 1:1 or 1:M?  If it is 1:M then the {relationships/3/FACILITYID} will return a count and not values.  Changing to 1:1 may work if you can.

The other option is to use Arcade and lookup the value yourself.   See this post on doing a lookup to a repeat Ask about the Related table came from the repeat table in Survey123 for ArcGIS, How to show its data... 

Then you would use {expression/expr0} to grab that value for the URL.

Hope that helps

0 Kudos
ElizabethHovsepian
New Contributor III

Hi,

Yes, some of them are 1:M, and I will not be able to change those. I am not familiar with Arcade, but I may fiddle around with it when I get some time. Thanks for your help!

0 Kudos
DougBrowning
MVP Frequent Contributor

A 1:M only returns a count, sum, or avg.  Which makes sense since it cannot list all the values it finds in a 1:M in one value.

This also means your Arcade will query and return a list.  You will need some type of code in there to pick out the one value you want.

0 Kudos