<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Updating Host Feature Layer View viewDefinitionQuery using the REST admin in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/updating-host-feature-layer-view/m-p/607100#M30338</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to have a hosted feature layer view be defined to show only the features from the previous day. &amp;nbsp;This is not the past 24 hours, but for the entirety of the previous day. &amp;nbsp;I was expecting to be able to update the viewDefinitionQuery using updateDefinition function in the REST admin. &amp;nbsp;However, I cannot use the EXTRACT date function in the definition query. &amp;nbsp;It appears that on the CURRENT_TIMESTAMP function is supported by views. &amp;nbsp;It works in the where clause when doing a query on the feature layer, however when set as the viewDefinitionQuery on the view, the query on the view&amp;nbsp;returns a 400 error:&lt;/P&gt;&lt;P&gt;{"error":{"code":400,"message":"Cannot perform query. Invalid query parameters.","details":["Unable to perform query. Please check your parameters."]}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The query I am attempting is:&lt;/P&gt;&lt;P&gt;EXTRACT(YEAR from Reported_Date) = EXTRACT(YEAR from CURRENT_TIMESTAMP -1) and EXTRACT(MONTH from Reported_Date) = EXTRACT(MONTH from CURRENT_TIMESTAMP -1) &amp;nbsp; and EXTRACT(DAY from Reported_Date) = EXTRACT(DAY from CURRENT_TIMESTAMP -1)&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Sep 2017 14:05:18 GMT</pubDate>
    <dc:creator>JustinGreco</dc:creator>
    <dc:date>2017-09-15T14:05:18Z</dc:date>
    <item>
      <title>Updating Host Feature Layer View viewDefinitionQuery using the REST admin</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/updating-host-feature-layer-view/m-p/607100#M30338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to have a hosted feature layer view be defined to show only the features from the previous day. &amp;nbsp;This is not the past 24 hours, but for the entirety of the previous day. &amp;nbsp;I was expecting to be able to update the viewDefinitionQuery using updateDefinition function in the REST admin. &amp;nbsp;However, I cannot use the EXTRACT date function in the definition query. &amp;nbsp;It appears that on the CURRENT_TIMESTAMP function is supported by views. &amp;nbsp;It works in the where clause when doing a query on the feature layer, however when set as the viewDefinitionQuery on the view, the query on the view&amp;nbsp;returns a 400 error:&lt;/P&gt;&lt;P&gt;{"error":{"code":400,"message":"Cannot perform query. Invalid query parameters.","details":["Unable to perform query. Please check your parameters."]}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The query I am attempting is:&lt;/P&gt;&lt;P&gt;EXTRACT(YEAR from Reported_Date) = EXTRACT(YEAR from CURRENT_TIMESTAMP -1) and EXTRACT(MONTH from Reported_Date) = EXTRACT(MONTH from CURRENT_TIMESTAMP -1) &amp;nbsp; and EXTRACT(DAY from Reported_Date) = EXTRACT(DAY from CURRENT_TIMESTAMP -1)&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:05:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/updating-host-feature-layer-view/m-p/607100#M30338</guid>
      <dc:creator>JustinGreco</dc:creator>
      <dc:date>2017-09-15T14:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Updating Host Feature Layer View viewDefinitionQuery using the REST admin</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/updating-host-feature-layer-view/m-p/607101#M30339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just came across something similar.&lt;/P&gt;&lt;P&gt;We were using the following as part of query against an ArcGIS Server feature service for a few years&lt;/P&gt;&lt;P&gt;EXTRACT(HOUR FROM ACCIDENTDATE) &amp;gt; '6'&amp;nbsp;&lt;/P&gt;&lt;P&gt;We moved that service to a hosted service in AGO and that query no longer worked. We got the same error message as Justin above.&lt;/P&gt;&lt;P&gt;Removing the apostrophes and adding&amp;nbsp;&amp;amp;sqlFormat=standard to the querystring made it work. Not exactly sure why though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2018 18:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/updating-host-feature-layer-view/m-p/607101#M30339</guid>
      <dc:creator>MatthewLofgren</dc:creator>
      <dc:date>2018-05-11T18:22:44Z</dc:date>
    </item>
  </channel>
</rss>

