Skip to main content
Solved

WHERE Clause for ArcGIS Online


Hi All,

I have a point feature service on AGOL which gets populated daily with new points, data and attachments.

I'm trying to make a WHERE clause for an AGOL reader so FME only reads data from the last 3 days. According to ArcGIS dev page https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm , the WHERE clause should look like this EditDate > CURRENT_TIMESTAMP - INTERVAL '03' DAY

 

.

However, FME gives me a fatal error.

Simple queries like EditDate > '2020-03-05 00:00:00.000' work just fine.

EditDate is esriFieldTypeDate and it comes into FME as '20200305235154.156000'

 

P.S. the script will be published to FME Server (Cloud), so the solution should work for the Server too.

 

Please help!

 

Best answer by aandronov

@bruceharold @ebygomm

Just found a solution! WHERE Clause should look like

EditDate > DateAdd(day,-3,getdate())

 

Yay!

 

View original
Did this help you find an answer to your question?

5 replies

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • March 9, 2020

I'm not familiar with how the query should be structured, but as an alternative you could swap the reader for a featurereader and ahead of this calculate the date 3 days ago to use in a simple where clause


bruceharold
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 9, 2020
ebygomm wrote:

I'm not familiar with how the query should be structured, but as an alternative you could swap the reader for a featurereader and ahead of this calculate the date 3 days ago to use in a simple where clause

I agree with @ebygomm I do this, figure out an expression for the where clause, works well.


  • Author
  • March 9, 2020
ebygomm wrote:

I'm not familiar with how the query should be structured, but as an alternative you could swap the reader for a featurereader and ahead of this calculate the date 3 days ago to use in a simple where clause

Thank you guys! This approach works fine for querying data from 3 last days; however, I struggle to find a way to read attachments from AGOL feature service using FeatureReader. Is there a way?

 

P.S. With a generic reader, I used AttributeExposer -> ListExploder to retrieve attachments. These 2 transformers don't do any good for the FeatureReader.


  • Author
  • Best Answer
  • March 11, 2020

@bruceharold @ebygomm

Just found a solution! WHERE Clause should look like

EditDate > DateAdd(day,-3,getdate())

 

Yay!

 


Forum|alt.badge.img+1
  • January 12, 2021
aandronov wrote:

Thank you guys! This approach works fine for querying data from 3 last days; however, I struggle to find a way to read attachments from AGOL feature service using FeatureReader. Is there a way?

 

P.S. With a generic reader, I used AttributeExposer -> ListExploder to retrieve attachments. These 2 transformers don't do any good for the FeatureReader.

Don't know if you have solved this yet... but I was stumped on this too!

Screenshot 2021-01-12 154438Attribute File Writer Properties:

Screenshot 2021-01-12 154504Feature Reader Properties:

Screenshot 2021-01-12 154524


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings