Attribute Rule: Generate a point in a new feature class

223
5
3 weeks ago
ZachBodenner
MVP Regular Contributor

Hi - it was brought to my attention that my post didn't go through correctly yesterday, so here's my second creack:

I want to write an attribute rule that will place a point in feature class B at the exact same location as one that is created in feature class A. I think this is fairly straightforward, but I must be missing something because I get an error that is simple 'Invalid function arguments.'  No further details. The expression itself evaluates fine.

var pf = Geometry($feature)
var t = $feature.AssetType



return {

    edit: [{

        "className": "epgdb.Parks.RecPts",
        "adds": [{
            "attributes": {
             "type": t
                        },
             geometry: pf
        }]
    }]
}

 

I'll flesh this out a little later, but I kind of just want to get it started. Any ideas for what is eluding me?

Happy mapping,
- Zach
0 Kudos
5 Replies
ChristopherCounsell
MVP Regular Contributor

Was this meant to be a question instead of a blog post?

0 Kudos
ZachBodenner
MVP Regular Contributor

Good question! I guess I'm a little unclear of how we're expected to use this Arcade community. It seems like it should be a place for all things Arcade, but maybe not? Should all questions still be in some other product forum? I'd be happy to move the post if this isn't where it should go.

Happy mapping,
- Zach
0 Kudos
BlakeTerhune
MVP Regular Contributor

There is a question section in the ArcGIS Arcade user group 😉

ArcGIS Arcade Questions - Esri Community

0 Kudos
AlfredBaldenweck
MVP Regular Contributor

Not sure what the issue is.

I copy-pasted your code directly into a test pair of points and it worked great (I did change the fields and the featureclass value, of course).

Caveat is that I tested in a file geodatabase, which of course raises the question of if you still have trouble if you test in one as well? (Also if that table actually exists/ you have edit permissions there?)

adds.gif

0 Kudos
JesseCloutier
Esri Community Manager

Sharing in case it's needed — MVPs do have the necessary permissions to move posts from one board to another: How to move a post. Our team is also happy to help if requested. @ZachBodenner, if you're intending this to be a question post rather than an informative blog article feel free to move this or let us know if you'd prefer we assist. 

Jesse Cloutier
Community Manager, Engagement & Content
0 Kudos