How to apply a query task on the feature layer that queries all the feature in the feature layer based on the Facilty_ID values inside the ilist.?
I have a table and a feature layer, the “Facility_ID” is the mutual field between the table and the feature class, after applying a query task on the table, I got all the Facilty_ID values stored in ilist of type (system.collection.Generic.IList<system.String>), Now, I want to apply a query task on the feature layer that queries all the feature in the feature layer based on the Facilty_ID values inside the ilist. Attached
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=906f20000000CLC&feoid=Body&refid=0EMf2000000E3uy" _/_img_
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=906f20000000CLC&feoid=Body&refid=0EMf2000000E3v3" _/_img_
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=906f20000000CLC&feoid=Body&refid=0EMf2000000E3v8" _/_img_
Thank you in advance.
Best,
Majdoleen
0
-
Any Idea??
Thanks in advance.
Majdoleen0 -
Hi Majdoleen,
It sounds like you would want to flatten that list down into a string, so that you can make a where clause that looks something like this:
Facilty_ID IN ('GHC0001', 'GHC0002', 'GHC0003')- Add an Assign before the QueryTask.
- On the left side of the Assign, use a new string variable (eg, facilityIdsString)
- On the right side, use this expression: String.Join("','", iList1)
- That will populate your facilityIdsString variable so that it looks something like GHC0001','GHC0002','GHC0001
- Combine the variable and the rest of the missing formatting needed in the Where property of the QueryTask: "Facility_ID IN ('" + facilityIdsString + "')"
Hope that helps!
-Amanda0 -
Thanks for this - it was exactly my scenario as well, and Amanda's solution worked like a charm.
-Jena0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
3 kommentarer