Getting a column from featurelayer attribute table as an array

587
3
Jump to solution
10-04-2021 12:21 AM
jerry1
by
New Contributor

New to ArcGIS API for Javascript, so apologies if this is a very basic/beginner question.

I have a feature table with a a few columns in it's attribute table, one of which is the 'date' column. Is it possible for me to extract just all the values the 'date' column, preferably as an array?

Thanks! 

0 Kudos
1 Solution

Accepted Solutions
Kishore
Occasional Contributor

Hi Jerry,

Use query feature layer and define your where condition as 1=1 and outFields is your required fields. 

Please refer to the link: https://developers.arcgis.com/javascript/latest/query-a-feature-layer-sql/

Thank you.

Regards,
Kishore

View solution in original post

0 Kudos
3 Replies
Kishore
Occasional Contributor

Hi Jerry,

Use query feature layer and define your where condition as 1=1 and outFields is your required fields. 

Please refer to the link: https://developers.arcgis.com/javascript/latest/query-a-feature-layer-sql/

Thank you.

Regards,
Kishore
0 Kudos
jerry1
by
New Contributor

I finally got it to work, thank you so much!

The issue with my code was that my where condition was set to "date != '' ", which didn't work at all, while the 1=1 condition works.

0 Kudos
Kishore
Occasional Contributor

Grate. 

You can also try with SQL statements such as "date IS NOT NULL".

Regards,
Kishore