Select to view content in your preferred language

Copy attributes from polygon to point not allowed?

1487
10
Jump to solution
09-14-2022 02:37 PM
Andy_Morgan
New Contributor III

I'm putting together a solution that apparently won't work for "Copy attributes", and I noticed your documentation doesn't seem to exactly match the copy attributes behavior in Field Maps.

I'd really like to copy attributes (in identically named fields) from a polygon layer to the target GPS point layer. It's not displaying the "Copy attributes" option when I select a polygon, but it does for a point layer in the same feature service. This is really unfortunate. Based on what I read below, it sounded like you can do anything across layers if you only want attributes copied: "The types you can choose are limited to those of the same geometry type."

Under Feature Actions, I have "Copy attributes" selected for the type.

I would think the documentation might as well say geometry must match for copy attributes to be enabled at all, or is there possibly some fix to make this work? I wish there was a way in Field Maps to programmatically copy attributes from a point based on the selected containing polygon. I have one parcel centroid point per polygon. Do I have any other options to make polygon to point work? The idea was to allow users to select a polygon feature for copying instead of the centroid point.    

 

Depending on the copy settings configured in the Field Maps web app, you can choose from the following options:

  • Copy attributes—Copy the feature's attributes to a new feature.
  • Copy shape—Copy the feature's shape to a new feature.
  • Copy all—Copy the feature's attributes and shape to a new feature.

Choose the type of asset or observation to capture.

The types you can choose are limited to those of the same geometry type (for example, length or area) as the feature you are copying.

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Yes I have like 30 of them using for 5 years now.  Here is a gif I have form a demo.  Sorry not sure the confusion this is pretty much SOP for a lot of folks.

This is going from Field Maps to 123 but its the same concept.  This one here you can launch 10 different forms and each one sends diff info.

Launch From Collctor tablet.gif

URL here is  arcgis-survey123://?itemID=6df2d78c25914668a7ad59d4cb090832&field:LOCAL_ID={LOCAL_ID}&field:FormID={FormID}&field:ADMIN_ST={AdminState}&callback=https://fieldmaps.arcgis.app

This one is 123 to Field Maps.

this URL is

<a href="https://fieldmaps.arcgis.app?itemID=bd19bf20c2c6430b8530940cb22dc21a&referenceContext=addFeature&fea...">Add a Point to Field Maps</a>

123 to FM launch.gif

 

I cant find a example of being all inside fields maps but I think I have seen it.  I do think the harder part is creating the URL with Arcade vs hardcoding.  But just get the URL looking right form these examples.

I thought there was a blog but cant find it.  See all these posts.  Just search the forum really.

Most of these are people having issues but it should help.  Not sure how many fields you need to send over but we tend to just send ID since the info is in the other layer.

https://community.esri.com/t5/arcgis-survey123-questions/trying-to-open-existing-record-in-survey123...

https://community.esri.com/t5/arcgis-field-maps-blog/callback-urls-how-do-i-get-this-thing-to-actual...

https://community.esri.com/t5/arcgis-field-maps-questions/custom-survey123-url-with-field-maps-callb...

https://community.esri.com/t5/arcgis-field-maps-questions/amp-character-in-field-name-breaking-url/m...

Hope that helps

View solution in original post

0 Kudos
10 Replies
DougBrowning
MVP Esteemed Contributor

I would look into using URL parameters for this.  We do this to pass fields from Field Maps to 123 all the time.  I am not positive it would work inside Field Maps but I think it may.

Read up here  https://doc.arcgis.com/en/field-maps/android/help/deploy-your-map.htm 

A relate will only copy the one key and not several fields.  You could leave the rest of the fields off and use the relate also.

Hope that helps

0 Kudos
ZakBaron
New Contributor III

I am not familiar with the 'Copy attributes' option, but this sounds like a good use for Arcade. Check out this blog post here:

https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/common-calculated-expressions-fo...

The first example sounds exactly like your use case.

0 Kudos
Andy_Morgan
New Contributor III

Thanks @DougBrowning and @ZakBaron for offering ideas. Perhaps I missed something, but neither of those seems to offer a workaround for my exact need of selecting a polygon, using the selected polygon to then select the centroid point, and then copy attributes from the centroid point to the GPS feature being collected.

URL parameters and relates are more for adding related features. Arcade solutions are for intersecting/containing polygons for wherever you're collecting a GPS feature, not what you clicked to manually select as the intended reference polygon to use for GPS point attributes. I cannot be guaranteed the GPS point will always be inside a polygon. It might be a few feet outside, and then the rule wouldn't apply. The user would have no direct control over which feature was used for copying attributes.

I'll keep exploring. I just wish "Copy attributes" would apply across any two geometry types (point to polygon, polygon to line, polygon to point, etc.). I realize you can press down on a field to manually copy a single attribute and the manually paste it into a field in the new point, but I'm designing a solution for 50-100 thousand points over 2 years. I need the field workers to not have to do something tedious like all these steps every time. Using the "Copy attributes" button is by far the fastest and most foolproof method.    

0 Kudos
DougBrowning
MVP Esteemed Contributor

You can use URL to create new features no problem, it is not just for related tables we just use it for that a lot.  

On the Arcade side you would have the popup of the point do a look up into the polygon layer using Intersects.  Not the other way around.

Hope that helps

0 Kudos
Andy_Morgan
New Contributor III

Absolutely no pressure to keep going with this conversation, but just to clarify the desired starting point for copying attributes is the user clicks on a parcel boundary (polygon) to indicate which feature they want to use for transferring the many field values we need in the new GPS point.

Polygon attributes -> GPS point using "Copy attributes" isn't possible out of the box in Field Maps.

I'm not following when you say "you'd have the popup of the point...". The goal is to not be clicking on a parcel centroid point like I have it now. I'd like them to click on parcel boundary polygons and exclude the centroid points layer entirely. They will clutter the map, since I have a separate meter point layer that will be used as well. Our field staff likely prefers to click on polygons instead of finding the appropriate point in the center. The problem is that the point to be collected by GPS isn't always inside the polygon.

Regardless of whether there is anything else to add, any input is much appreciated! 

FieldMaps_example_parcel_boundary_small.jpg

0 Kudos
DougBrowning
MVP Esteemed Contributor

In the popup for the polygon just use a URL to create a feature.  Then you can pass all the attributes you want from that polygon to the new feature.  Just give it a shot its pretty easy to setup.

0 Kudos
Andy_Morgan
New Contributor III

I really do want to follow you, but again I'm not clear. It's not that I don't understand how to write code, it's that I don't understand how to implement what I think you're suggesting: to generate a custom URL in a field value that'll display within the polygon popup...and the click event for this URL will somehow trigger a function to send all the selected polygon attribute values to the new GPS feature ($feature) through Arcade.

That's a giant stretch from what I thought was even possible in an AGO web map + Arcade. Is this something people are already doing with examples, or something you suspect is possible but haven't actually done yourself? Just wanted to be clear. It may seem quick and easy , but that's because you already know how to do it. There are at least two steps in this workflow for which I'm not able to find ESRI documentation, so it's not obvious to me yet.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Yes I have like 30 of them using for 5 years now.  Here is a gif I have form a demo.  Sorry not sure the confusion this is pretty much SOP for a lot of folks.

This is going from Field Maps to 123 but its the same concept.  This one here you can launch 10 different forms and each one sends diff info.

Launch From Collctor tablet.gif

URL here is  arcgis-survey123://?itemID=6df2d78c25914668a7ad59d4cb090832&field:LOCAL_ID={LOCAL_ID}&field:FormID={FormID}&field:ADMIN_ST={AdminState}&callback=https://fieldmaps.arcgis.app

This one is 123 to Field Maps.

this URL is

<a href="https://fieldmaps.arcgis.app?itemID=bd19bf20c2c6430b8530940cb22dc21a&referenceContext=addFeature&fea...">Add a Point to Field Maps</a>

123 to FM launch.gif

 

I cant find a example of being all inside fields maps but I think I have seen it.  I do think the harder part is creating the URL with Arcade vs hardcoding.  But just get the URL looking right form these examples.

I thought there was a blog but cant find it.  See all these posts.  Just search the forum really.

Most of these are people having issues but it should help.  Not sure how many fields you need to send over but we tend to just send ID since the info is in the other layer.

https://community.esri.com/t5/arcgis-survey123-questions/trying-to-open-existing-record-in-survey123...

https://community.esri.com/t5/arcgis-field-maps-blog/callback-urls-how-do-i-get-this-thing-to-actual...

https://community.esri.com/t5/arcgis-field-maps-questions/custom-survey123-url-with-field-maps-callb...

https://community.esri.com/t5/arcgis-field-maps-questions/amp-character-in-field-name-breaking-url/m...

Hope that helps

0 Kudos
Andy_Morgan
New Contributor III

Thanks @DougBrowning for staying with me and offering more explanation and links. After some experimenting I see it's possible to get attributes transferred over. I never would have thought you can do a loop within Field Maps to call it with a URL from the popup. I don't like how you have to click the target GPS layer again when it reloads, but I saw in a separate thread ESRI did it by design for layer templates. I suppose this type of solution is better for what I need and more customizable all around.

Certainly not an obvious workaround, and unfortunately a lot of effort that could have been avoided if attributes could simply be copied across various geometry types.