Hi Sravanthi Murali,
// return an array of unique values in
// the STATUS2 field of the wells layer
From the comments in the JavaScript code you point to (ArcGIS API for JavaScript Sandbox) I can see that the well-type options for the select tag is populated with unique values from the STATUS2 field of the wells layer, i.e. the portal item with the id: "8af8dc98e75049bda6811b0cdf9450ee":
https://www.arcgis.com/home/item.html?id=8af8dc98e75049bda6811b0cdf9450ee
This Feature Layer (owned and published by the jsapi_team) points to this Layer https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/HarperSumnerOGWells/FeatureServer/...
You can, for example, query this layer for wells where STATUS2 = 'KCC Fee Fund Plugging'. This will return 23 wells.
Execute this query to see these 23 wells:
https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/HarperSumnerOGWells/FeatureServer/...
Hope this helps to get your own code running 🙂
P.S. If you think this answer is correct, please feel free to mark it as such, as this will earn me a whopping 250 points on GeoNet...
BR,
Egge-Jan