Zum Hauptinhalt gehen

Relationship Query Task Activity

Kommentare

5 Kommentare

  • Permanently deleted user

    Via another thread, I got my second question answered.  But the first question remains unanswered.  Although I can hard-code an FID into the Object IDs parameter, how would I get the actual FID of the feature clicked on, with the resulting FeatureSet?  Would I access a Rows property, then a Fields property, then a dictionary or something?

    "Roj"

    0
  • Permanently deleted user

    Hi Roger,

    If you have a feature set (called featureSet1 for example), you can get the object id of the first feature by using the following syntax:

    featureSet1.features(0).attributes("OBJECTID").toString

    You can use this directly in the Object Ids parameter of the Relationship Query Task activity, or if you want to use multiple Object IDs you can loop through all of the features in the feature set and append them to a string variable with commas between each object id. You would then need to change the '0' in the above line to use the incrementing index.

     

    0
  • Permanently deleted user

    Hi Roger & Victoria,

    Could either of you elaborate on how you implemented the "loop through all of the features in the feature set and append them to a string variable with commas between each object id"?

    Thanks,

    Warren

    0
  • Permanently deleted user

    Warren,

    1. Declare a variable of type String that will hold the delimited string, and set its Default Value to "" OR set it to the base value of what you need.  In my case, it was the base URL of the page that needed to be opened.
    2. Declare another variable called bAddComma of type Boolean and set its Default value to False.
    3. From the Control Flow category, drop the For Each <T> tool onto your workflow.  You will have to pick a type for T, so choose ESRI.ArcGIS.Client.Graphic .
    4. Supply your FeatureSet as the Values property.
    5. In the diagram, supply a name for the Foreach argument.  This doesn't appear to show up as a variable, though, neither does it appear in the Properties window on the right.  Hm.
    6. Inside the Body of your For Each tool, drop a Sequence .
    7. Inside the Sequence , drop an If tool.  The Condition for the If tool is the Boolean you declared (bAddComma).
    8. In both the  Then and the  Else boxes, drop an Assign tool.
    9. In the  Then  Assign tool, assign your String to be itself plus ", ".
    10. In the  Else  Assign  tool, assign your Boolean (bAddComma) to be True for next time around.
    11. Drag another Assign tool onto the workflow, after the If tool.  Assign your String to be itself plus your  Foreach argument.Attributes("<fieldname>").ToString.
    12. For debugging purposes, you can drop a Write Line after the last Assign and set its  Text property to the String you're concatenating.  When you're debugging, you should see this string get set to a longer and longer, comma-delimited, string.
    13. Outside of the For Each tool, you can do what you need to with the String, like put it in a URL, use it for another Query, show it to the user, etc.

    I hope this helps!

    "Roj"

    0
  • Permanently deleted user

    Hi Roger,

    That worked perfectly! Thanks so much for replying.

    Warren

    0

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