Hello,
I have a point feature layer (lyr1) with a related table (tbl1) in AGOL. Each point has multiple related records. For QC purposes, I am trying to find a way to prepopulate a survey123 field with the related records. For example:
Building1 (point) has 3 related records with the following fields: building name, height, population, and age. I am trying to create a survey for the point layer that when a building is selected, the opened survey will have the same fields (name, height, pop, age) but populate these fields with the values from all the related records for the point. Is this possible?
Thank you for the help
I think you mean grab some fields from a related table and then send that to a 123 form?
Not sure what you mean on this part though "but populate these fields with the values from all the related records for the point". You cant multiple values into one field so not sure what you mean there. If you mean multiple repeats into multiple repeats that gets harder since you have to pull all 3, pass it into the main part of the form in dummy fields, then pass all of those to the related.
I do this a lot. Here is how if you are all offline.
My parent points are all in Field Maps as is the related layer or table.
I create Arcade fields in the map using this code to go get the related table info
var tbl = FeatureSetByRelationshipName($feature, "Points", ['DesignLat'], false);
return First(tbl).DesignLat
I then have a Launch URL in Field Maps pop up that grabs this Arcade field and passes it over to 123.
arcgis-survey123://?itemID=81257491d7ef1194dac&field:DesignLat={expression/expr6}
Pretty slick once you get it going.
If you want to be all in 123 and are online I would take a look at pulldata(@layer)
Hope that all makes sense.
Hi Doug,
Thanks for the tip on passing an arcade expression, that may be quite useful for me! This set up needs to work offline so pulldata is not feasible unfortunately. To be clearer, what I am trying to achieve here is to find a way that instead needing to select every related record individually (sometimes up to 30) and QC'ing it, I want to create a form that will combine (append) all related records for the selected point. So that when one selects a point and opens the survey123 form, the values for all related records are in there. Basically like in an excel sheet. The more I think about the less doable it seems.
Thanks a lot for the help.
Yea 30 will be too many. Is the user in the form and you are just QCing before they submit? I do summary pages using join() for this.
It even highlights potential issues in red
Thanks Doug,
I will investigate using the join() function. In my case, the user has submitted the forms and I am QC'ing afterwards. So that is why I'm trying to find a way to get the related records into one form. Thanks again.
Oh we use Dashboard for that now. Take a look there we get pretty fancy with them. Also use basic Python scripts to kick out reports.
@DougBrowning You are showing all related records for a point in dashboard? In a list? Table? Popup? And can you edit the features there?
@YS2388 Did you find a solution. I have figured out how to use arcade and read all related records in the popup (without the back and forth through them all), but now I want to set it up so users can read one long record of all the point details and related details and edit them.
You can create a map and then add that map to a dashboard to see all the layers. But no Dashboards do not let you edit at all. You can use links to a 123 widget or Field Maps widget in a dashboard but its not going to be all one line.
If you really want to edit the two options I have seen the best (besides just a web map) is using the Table Widget and either 123 widget or Field Maps forms widget to edit right there. This is still table by table though. You cannot join all in one line then edit - at least I have never seen it. That makes sense since parent fields will be listed many times, does it change all the of them when you change one? They should all point to the same data source so in theory I get it but its not designed that way. When you have a 1:M its just the way it works. You can even push the parent fields you want into the children but then editing goes away.
I would also look into ArcGIS for Excel. There you can have Excel have one sheet per layer and flip between them easily. You can edit right there in Excel. Maybe, big maybe you could move the parent data columns into the child sheet and the links would work. You could try it.
I get that both of you are trying to make a big flat file then edit but its just not how related tables are designed. Database views, joins, etc all take away the ability to edit as far as I have seen.
Sorry about all I got.