Select to view content in your preferred language

Get data from feature layer Query on Date

259
3
06-07-2024 08:22 AM
MJune
by
New Contributor II

I am trying to use the Get data from feature layer to bring back any records that have been created in the last seven days.  Every time I try to query on a date file I receive an error "Cannot perform query.  Invalid query parameters".  If i query the Feature Layer on a field that is not date, i have not issues.  It is only when I attempt to query on the date fields.  I have tried using the Available Fields/Comparison Type/Search Parameter Value and the Where fields to do this.  Does anyone have any ideas?

Below are some screen shots of my flow steps with the formula's shown.

 

MJune_0-1717773423268.png

 

MJune_1-1717773486556.png

 

 

0 Kudos
3 Replies
PavelJilinski
New Contributor

Hi,
Could you please check a couple of things:
1. If you use the drop-down and select the field "Created_date" does it work?
2. What is the datatype of the field created_date?

From your query, it seems that you are likely passing a Unix Epoch (integer) to a date-type field.

0 Kudos
MJune
by
New Contributor II

I attempted to use the drop-down and select the field, that did not work either.  The created_date is a "Date" field.  I was attempting to use a regular date format without success.  When i pull back all records, the created_date field is in the Unix Epoch format

0 Kudos
PavelJ
by Esri Contributor
Esri Contributor

Hello,
Thanks for your feedback. I was able to reproduce and identify the issue.
You need to provide the date as a string, such as '2024/01/23'. See the example below.

PavelJ_0-1718910994662.png

Please, for now, add single quotation marks (') around the date: for example: '2024/02/14'.

0 Kudos