Zum Hauptinhalt gehen

Edit Attributes of Newly Added Features

Kommentare

3 Kommentare

  • Permanently deleted user
    Hi Craig, 

     

    You actually want to assign the attributes to the new feature before the "Add Features" activity so that once the feature has been added to the layer, it already contains the geometry and the attributes. 

     

    I'm not sure how your workflow is set up but I assume you have a Query Task to find the geometry of the feature you want to copy. So the activity returns a featureSet containing that feature. 

     

    Next you will use that feature to create your new feature in a series of Assign activities like this:  newFeature = new Graphic newFeature.Geometry = featureSet.Features.First().Geometry //Assign geometry to new feature newFeature.Attributes("NewPropertyID") = featureSet.Features.First().Attributes("PropertyID") //Assign attributes

     

    You can assign the new feature as many attributes as you want following the last line in the code above. Once everything has been assigned, you can add the new feature to a new feature set, and then reference that feature set in the "Add Features" activity. This code gallery sample:

     

    https://support.geocortex.com/essentialsGSCCodeGallery?sub-nav=codegall&main-nav=essentials&#!/feedtype=SINGLE_ARTICLE_SEARCH_RESULT&id=kA4600000004EWU

     

    is not exactly what you are looking for but it will definitely help you get started. The "AddPoint.xaml" in particular is very close to what you want to achieve. 

     

    I hope this helps

     

    Carmen
    0
  • Permanently deleted user
    Carmen,

     

    Thanks so much for responding.  I was able to work out a solution using the resources you provided. 

     

    I wish I had asked sooner!

     

    For anyone who looks at this in the future, I used an iterator in a ForEach<Graphic> activity to copy multiple features.  In this case, I needed to use: newFeature.Attributes("Parcel_ID") = featureSet.Features.Item(whileInt).Attributes("PIN") Rather than newFeature.Attributes("Parcel_ID") = featureSet.Features.First().Attributes("PIN") whileInt is an Int32-type variable with Default set to 0. As the workflow processes each feature in the feature set, it also increments the whileInt variable by '1' to match the index of the according features in the feature set.

     

     
    0
  • Permanently deleted user
    This was very helpful thank you. Not a related question, but perhaps you can help me. I would like to findout how to change a field name in my FeatureSet?

     

    Any assistance is appreciated!

     

     
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.