Skip to main content

Extract OBJECTDs from a featureset to CSV

Comments

4 comments

  • Permanently deleted user
    Hi Hani,

     

    You can use the activity "Get Attribute Values <T>" using Int32 as the type. That will extract a particular attribute from all the features on a Feature Set and store it in an iList<T>. Then you can generate the comma separated string by doing:

     

    String.Join(",",iList)

     

    Hope it helps,

     

    Alejandro
    0
  • Permanently deleted user
    Hi Aljendro,

     

     

     

    Thank you very much for your helpful input,

     

    I tried your suggestion. However, the "Get Attribute Values <T>" returned nothing. This is better elaborated with the screenshots below:

     

    My workflow does the following: It takes the input from a DisplayForm, and apply a query on a layer based on this input, the resultant is a FeatureSet (fs0), then it selects the features of fs0. After that I added GetAttributeValues<int32> to extract the ObjectIDs only from the fs0 FeatureSet , then I added an “Alert” activity to view the extracted ObjectIDs by using “String.Join(",",iList)” in the alert’s. but, the Alert showed nothing.

     

     

     

    1- My workflow with the variables in each activity

     

     

     

     User-added image

     

     

     

    Running the Workflow

     

     

     

     User-added image

     

     

     

    The query find the wanted features, and they are selected. BUT, the Alert shows nothing, which means that the ObjectIDs are not extracted

     

     

     

     User-added image

     

     

     

    What do you suggest?

     

     

     

    Once again, Thanks a lot for the help!
    0
  • Nico Burgerhart
    I think there are three alternatives.
    • On the query task, use Return IDs only to return a featureset with only IDs, and use this featureset for the datatable
    • Use the Get Object IDs activity instead of the Get Attribute Values activity
    • I think it is also possible to modify your datatable (removing columns)
    0
  • Permanently deleted user
    Thank you very much Nico,

     

    I tried your solution, and it worked perfectly!

     

    Much Appreciated!
    0

Please sign in to leave a comment.