Skip to main content

how to query related table information and return graphics?

Comments

7 comments

  • Permanently deleted user

    I still need help with this!  Here are screenshots of my workflows:

    /customer/servlet/servlet.FileDownload?file=00P6000000elu5iEAA

    /customer/servlet/servlet.FileDownload?file=00P6000000em1UzEAI

    /customer/servlet/servlet.FileDownload?file=00P6000000em1AvEAI

    /customer/servlet/servlet.FileDownload?file=00P6000000eluLHEAY

    /customer/servlet/servlet.FileDownload?file=00P6000000em1TXEAY

    /customer/servlet/servlet.FileDownload?file=00P6000000elzjCEAQ

    0
  • Permanently deleted user

    If the table that you are querying for the category contains an OBJECTID field, then the easiest way to get this working would be to return the OBJECTID field as the Value in the DisplayForm, rather than the Category.

    /customer/servlet/servlet.FileDownload?file=00P6000000eltrvEAA

    This way, the user will select the CATEGORY name, but it will be the OBJECTID for that record that gets saved to the Selection_LC variable.

    The RelationshipQueryTask lets you specify a list of OBJECTID fields, and then returns the related records that are associated with those OBJECTIDs. So, because the user has only interacted with the category Table so far, the QueryServiceUrl would be the URL to the category table, the same as you used in the combo box properties in the Display Form. The Object Ids field would contain Selection_LC (the OBJECTID of the category the user chose), and the results would be all of the features in the Lakes Layer that are related to the category the user chose.

    If your table does not contain an OBJECTID field, it would be better to use a regular QueryTask activity instead of the RelationshipQueryTask. You would change the Value in the DisplayForm from CATEGORY to whatever field links the table to the layer (might be category, or another ID field besides OBJECTID. This is the field in the Table ). Then in the QueryTask, the QueryServiceURL would be set to the URL of the Lakes layer, and the Where clause would be something like Where: "f1 = '" + Selection_LC + "'"

    f1 would be whatever the name of the field that links the layer to the table (the field in the Layer ). 

    So if the relationship joined the LakeID field in the layer to the LakeCatField in the table, the Value in the Display form would be set to LakeCatField, and the Where clause in the QueryTask would be set to Where: "LakeID = '" + Selection_LC + "'"

    -Victoria

    0
  • Permanently deleted user

    Do you mean the Object ID of the feature class that it is related to, or the Object ID of the table itself?

    0
  • Permanently deleted user

    I think almost all references to OBJECTID in my post are to the OBJECTID of the table itself, not the feature class. However, I'll admit it's a bit confusing for me to read back now as well, sorry about that!

    Note that the first half of my post describes a solution for if the table itself contains an OBJECTID field. If it doesn't and the only OBJECTID field is in the feature class, you should only pay attention to the second half.

    -Victoria

    0
  • Permanently deleted user
    I eventually solved this problem of related table querying.  It has nothing to do with any of the relationship query tasks.  I can't figure out how to attach the workflow and it won't allow more than so many characters itno a reply now so I can't post it apparently.  So if you want to see it, just contact me.  But here is an outline of what goes on.

     

    1. I made a table of the unique values for the drop down combobox (if not, it won't be a unique value only list) and used that user picked value to query the related table (no conversions or anything).  

     

    2. In the query task on the related table, I set the output fields to the primary key that links the table with the feature class.  

     

    2a. decision making sure the results are >0 otherwise alert "no results"

     

    3. Then I gather the attribute values using a "Get Attribute Values <String>", using my latest featureset and the attribute is my uniqueID I spit out.

     

    3a. Decision whether the results is only 1 or multiple.

     

    4.  Then I shoved that featureset into a list, created a string from the list using a "For Each <String>" and an assign, seperating out (from above decision) one result (Qry_WATER_ID= "'"+item.ToString()+"'") and multiple (Qry_WATER_ID= Qry_WATER_ID+ ",'" + item.ToString()+"'") for the string.  

     

    5.  Then made a new query string for the final query on the feature class (QryValue = "WATER_ID in ("+Qry_WATER_ID+")").  

     

    6.  Then I finally query the feature class using this QryValue I made, returning all fields as an output ("*")  and the selecting.
    0
  • Permanently deleted user
    Hi Jacqueline

     

    I am working on a very similar workflow right now. I'd really like to see your workflow if you don't mind sharing.

     

    Thanks a lot

     

    Simon
    0
  • Permanently deleted user
    For anyone looking for the workflow referenced above, it can be found here - 

     

    http://data.latitudegeo.com/community/wf_lakecategory2.zip

     

    Wayne Richard

     

    Latitude Geographics Group Ltd.

     

    Head Office: 300 – 1117 Wharf Street  Victoria, BC Canada V8W 1T7

     

    Tel: (250) 381-8130 | Fax: (250) 381-8132 | wrichard@latitudegeo.com

     

    Developers of Geocortex web-based mapping software | www.geocortex.com

     

    An Esri Platinum Business Partner
    0

Please sign in to leave a comment.