<?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 Re: Update hosted layer view definition w topfilter to show only most recent record in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343823#M55481</link>
    <description>&lt;P&gt;Liam,&lt;/P&gt;&lt;P&gt;I have watched the video. From what I see, you are applying updateDefinition to the feature service and not the layer. You need to go to the layer and set the topfilter on the layer using the layer updateDefinition. You cannot update topfilter in feature service updateDefinition API.&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2023 14:04:47 GMT</pubDate>
    <dc:creator>KhaledHassen</dc:creator>
    <dc:date>2023-10-31T14:04:47Z</dc:date>
    <item>
      <title>Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455820#M22938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a hosted table with many records and would like to create a view layer from this that only shows the most RECENT record.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a view layer and attempted to update the view definition using the TOPFILTER via the admin API.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Layer Definition:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt; "adminLayerInfo" : {&lt;BR /&gt; "tableName" : "db_4176.user_4176.CASES_TABLE_CASES_TABLE", "geometryField" : null, &lt;BR /&gt; "xssTrustedFields" : "", &lt;BR /&gt; &lt;STRONG&gt;"viewLayerDefinition" : {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; "sourceServiceName" : "Cases_Table", &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; "sourceLayerId" : 0, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; "sourceId" : 984, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; "sourceLayerFields" : "*"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; }&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; },&lt;/STRONG&gt; &lt;BR /&gt; "id" : 0, &lt;BR /&gt; "name" : "Cases_Table", &lt;BR /&gt; "type" : "Table", &lt;BR /&gt; "isView" : true, &lt;BR /&gt; "isUpdatableView" : true, &lt;BR /&gt; "sourceSchemaChangesAllowed" : true, &lt;BR /&gt; "displayField" : "", &lt;BR /&gt; "description" : "", &lt;BR /&gt; "copyrightText" : "", &lt;BR /&gt; "defaultVisibility" : true,&lt;/P&gt;&lt;P&gt;ETC...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I need to insert something like the following, but can't get it to work successfully:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; "viewLayerDefinition" : {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; "topFilter" : {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; "orderByFields" : "reportdt ASC",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; "topCount" : 1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; }&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an example of successfully using topFilter (or some other method) to filter a layer view down to just the most recent record?&amp;nbsp; This is in support of a COVID-19 project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2020 15:47:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455820#M22938</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2020-04-07T15:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455821#M22939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes esri internally using the topFilter to view most recent record in view as well and in similar projects related to&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;COVID-19.&lt;/SPAN&gt; &amp;nbsp;Not aware of any issues. This should work. Let me know if it does not or having issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Khaled Hassen&lt;/P&gt;&lt;P&gt;Online Feature Service Software Dev Lead&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2020 16:11:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455821#M22939</guid>
      <dc:creator>KhaledHassen</dc:creator>
      <dc:date>2020-04-10T16:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455822#M22940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Khaled, Thansk for responding.&lt;/P&gt;&lt;P&gt;When I open the admin api for the view layer I want to restrict to the most recently updated row of the data I see this:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/488234_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attempt to update the ViewLayerDefinition like as shown in yellow highlight:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/488243_pastedImage_3.png" /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;When I click Update Layer Definition it looks like it worked, but if I look at the ViewLayer data there is no filtering occurring - ALL the records are still shown. I also tried changing the Format to JSON and when I click UPDATE LAYER DEFINITION button I get a good-looking message:&lt;/P&gt;&lt;P&gt;{ "success" : true }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I go back to look at the admin api again, it appears that my changes didn't stick:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/488244_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions where I'm going wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2020 17:38:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455822#M22940</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2020-04-10T17:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455823#M22941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using the wrong json. I should be something like:&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "viewLayerDefinition" : {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"sourceServiceName" : "...",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"sourceLayerId" : 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "sourceLayerFields" : "*",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "topFilter" : {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You do not need to set all these props.&lt;/P&gt;&lt;P&gt;Can you pl try it out and let me know. This should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Khaled&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2020 17:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455823#M22941</guid>
      <dc:creator>KhaledHassen</dc:creator>
      <dc:date>2020-04-10T17:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455824#M22942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Making some progress - I didn't realize I could just put in only the portion I want to change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I cleared the box and just put in this:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; "viewLayerDefinition" : {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "sourceServiceName" : "CaseTable", &lt;BR /&gt;&amp;nbsp; &amp;nbsp; "sourceLayerId" : 0, &lt;BR /&gt;&amp;nbsp; &amp;nbsp; "sourceId" : 1033, &lt;BR /&gt;&amp;nbsp; &amp;nbsp; "sourceLayerFields" : "*",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "topFilter" : {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"orderByFields" : "reportdt ASC",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"topCount" : 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;That change actually "stuck", which is progress.&amp;nbsp; Now when I go back to the admin api it looks like this:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/488245_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still not getting filtering in the view layer though.&amp;nbsp; I still see all the records, not just the top one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2020 18:29:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455824#M22942</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2020-04-10T18:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455825#M22943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure why you stuck. are you using async=true? try to avoid that for quick update.&lt;/P&gt;&lt;P&gt;At any case, I do not see you are passing groupby. you need to pass a group by field. This is how we group by records and pick the record. Do you have any issue passing groupby.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Khaled&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2020 18:34:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455825#M22943</guid>
      <dc:creator>KhaledHassen</dc:creator>
      <dc:date>2020-04-10T18:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455826#M22944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Khaled, you are my hero today.&amp;nbsp; Issue resolved!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For others who might come across this question, I ended up going to the admin API, deleting all the text that is there by default and pasting in only what is shown in this screen shot:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/488267_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;"reportdt" is my field for the datetime the record was entered in the table.&lt;/P&gt;&lt;P&gt;"name" is another of my fields that was suitable for grouping by.&lt;/P&gt;&lt;P&gt;Clicked the Update Layer Definition button and got&amp;nbsp;a confirmation message.&lt;/P&gt;&lt;P&gt;The view layer now shows only the most recent record in the table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Totally awesome, thanks again Khaled!&lt;BR /&gt;&lt;BR /&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2020 20:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/455826#M22944</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2020-04-10T20:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1105472#M42466</link>
      <description>&lt;P&gt;Thanks for sharing Jay!&amp;nbsp;&lt;/P&gt;&lt;P&gt;We ran into some issues applying the filter above. In the end, the solution was to select ASync = false and format = HTML in the form while updating the service definition.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 10:04:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1105472#M42466</guid>
      <dc:creator>nvdv</dc:creator>
      <dc:date>2021-10-07T10:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1311255#M53516</link>
      <description>&lt;P&gt;Thank-you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/303437"&gt;@JayJohnsonWashoeCounty&lt;/a&gt;&amp;nbsp; your post definitely made the win for the day in accomplishing a task of showing the last 2 records in a feature layer. I have been going over different solutions (that haven't worked) and so excited to see your solution. thank-you for posting!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 22:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1311255#M53516</guid>
      <dc:creator>kmsmikrud</dc:creator>
      <dc:date>2023-07-24T22:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1339517#M55182</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148945"&gt;@KhaledHassen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I feel like I'm so close to getting this right, but it's just eluding me.&amp;nbsp; I have a database where my groupby fields is StaffEmail and I want to return the latest position (using the date field&amp;nbsp;"esrignss_fixdatetime").&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've created the update and successfully updated but my view still shows multiple entries for each email address.&amp;nbsp; What am I missing?&lt;/P&gt;&lt;PRE&gt;{&lt;BR /&gt;   "viewLayerDefinition" : {&lt;BR /&gt;   "sourceServiceName" : "CheckIn",&lt;BR /&gt;   "sourceLayerId" : 0,&lt;BR /&gt;   "sourceLayerFields" : "*",&lt;BR /&gt;   "topFilter" : {&lt;BR /&gt;      "orderByFields" : "esrignss_fixdatetime DESC",&lt;BR /&gt;      "groupByFields" : "StaffEmail",&lt;BR /&gt;      "topCount" : 1&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;Is it ASync? I don't know what that does.&amp;nbsp; Is it Format?&amp;nbsp; I've tried both.&amp;nbsp; I'm not getting error messages when I update and the update seems to hold BUT again, I'm still not seeing a view layer where each user (email address) is linked to a single point feature.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 12:28:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1339517#M55182</guid>
      <dc:creator>LiamHarrington-Missin</dc:creator>
      <dc:date>2023-10-19T12:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1339527#M55183</link>
      <description>&lt;P&gt;That looks right to me. I have recently fixed an issue related to topfilter. The fix will be available next week as part of online feature service update. So please try it again with the update.&lt;/P&gt;&lt;P&gt;If it is the same bug I have fixed, then if you retry apply the topfilter. It will finally work. So please try it again another time and see if this is fixed. If not, please wait until next week for the fix.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 12:53:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1339527#M55183</guid>
      <dc:creator>KhaledHassen</dc:creator>
      <dc:date>2023-10-19T12:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1339541#M55184</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148945"&gt;@KhaledHassen&lt;/a&gt;, I'll wait a week and have another crack.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm curious, a work around that I attempted, given my fear of all things API, was to use the "join" analysis tool (in webmap classic not new, so I can create the feature view instead of a feature layer) and create a join to itself.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in subsequent settings, I'd use a one-one-join around StaffEmail and use the FixTime to determine which record is retained...&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would be a cheeky workaround admitedly and it doesn't work but I'm not sure &lt;STRONG&gt;why&lt;/STRONG&gt; it doesn't work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 13:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1339541#M55184</guid>
      <dc:creator>LiamHarrington-Missin</dc:creator>
      <dc:date>2023-10-19T13:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343212#M55413</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/148945" target="_blank"&gt;@KhaledHassen&lt;/A&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm still not seeing the desired behaviour I want and can't figure it out.&amp;nbsp; Help.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've created a &lt;A href="https://osrl.maps.arcgis.com/home/item.html?id=e9ef020daa97443fa30fe2789577333f#overview" target="_self"&gt;test feature service&lt;/A&gt; that shows what data architecture I have.&amp;nbsp; You'll see 11 records, of which there are five unique entries in the "Email" col.&amp;nbsp; I want to create a feature view that shows only the most recent records for each email address.&amp;nbsp; E.g. the feature view will show 5 records, each showing the record that corresponds with the most recent "Fix Time" per email.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Everything I have tried to date is simply showing me the original 11 entries.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 11:59:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343212#M55413</guid>
      <dc:creator>LiamHarrington-Missin</dc:creator>
      <dc:date>2023-10-30T11:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343260#M55419</link>
      <description>&lt;P&gt;Hi Liam,&lt;/P&gt;&lt;P&gt;I think you should be able to create a view with the topfilter for this service. Can you pl. provide us with the steps to create the view in our side based on this data. We can try to repro it. I think the step that should work as follows:&lt;/P&gt;&lt;P&gt;- Create an empty view&lt;/P&gt;&lt;P&gt;- Call add to definition and link the view to the source&lt;/P&gt;&lt;P&gt;- Use update definition to change the topfilter.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Khaled&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 14:00:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343260#M55419</guid>
      <dc:creator>KhaledHassen</dc:creator>
      <dc:date>2023-10-30T14:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343707#M55461</link>
      <description>&lt;P&gt;Really appreciate the the prompt response&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148945"&gt;@KhaledHassen&lt;/a&gt;, This is driving me nuts, I'm sure it's a user error.&lt;/P&gt;&lt;P&gt;I screen recorded the, clearly incorrect, process I am following to try and achieve this and below is the code snippet.&amp;nbsp; Any insights would be greatly received.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Liam&lt;/P&gt;&lt;PRE&gt;{&lt;BR /&gt;"viewLayerDefinition" : {&lt;BR /&gt;"sourceServiceName" : "Check_In_testDataset",&lt;BR /&gt;"sourceLayerId" : 0,&lt;BR /&gt;"sourceLayerFields" : "*",&lt;BR /&gt;"topFilter" : {&lt;BR /&gt;"orderByFields" : "&lt;SPAN&gt;Fix_Time&lt;/SPAN&gt; DESC",&lt;BR /&gt;"groupByFields" : "&lt;SPAN&gt;Email&lt;/SPAN&gt;",&lt;BR /&gt;"topCount" : 1&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Oct 2023 09:15:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343707#M55461</guid>
      <dc:creator>LiamHarrington-Missin</dc:creator>
      <dc:date>2023-10-31T09:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343805#M55478</link>
      <description>&lt;P&gt;Hi Liam,&lt;/P&gt;&lt;P&gt;Can you pl. try only the topfilter.&lt;/P&gt;&lt;PRE&gt;{&lt;BR /&gt;"viewLayerDefinition" : {&lt;BR /&gt;"topFilter" : {&lt;BR /&gt;"orderByFields" : "&lt;SPAN&gt;Fix_Time&lt;/SPAN&gt; DESC",&lt;BR /&gt;"groupByFields" : "&lt;SPAN&gt;Email&lt;/SPAN&gt;",&lt;BR /&gt;"topCount" : 1&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Khaled&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 13:44:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343805#M55478</guid>
      <dc:creator>KhaledHassen</dc:creator>
      <dc:date>2023-10-31T13:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343816#M55479</link>
      <description>&lt;P&gt;No joy&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148945"&gt;@KhaledHassen&lt;/a&gt;.&amp;nbsp; I tried it with different combinations of "ASync" and "Format", since I'm clueless about what they mean or do.&amp;nbsp; Happy to jump on a screen share if you want to fasttrack troubleshoot? Just private msg. me.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 13:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343816#M55479</guid>
      <dc:creator>LiamHarrington-Missin</dc:creator>
      <dc:date>2023-10-31T13:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343823#M55481</link>
      <description>&lt;P&gt;Liam,&lt;/P&gt;&lt;P&gt;I have watched the video. From what I see, you are applying updateDefinition to the feature service and not the layer. You need to go to the layer and set the topfilter on the layer using the layer updateDefinition. You cannot update topfilter in feature service updateDefinition API.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 14:04:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1343823#M55481</guid>
      <dc:creator>KhaledHassen</dc:creator>
      <dc:date>2023-10-31T14:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1344964#M55599</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="excited-minions-gif.gif" style="width: 200px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84824i349AD437ED8E2E30/image-size/small?v=v2&amp;amp;px=200" role="button" title="excited-minions-gif.gif" alt="excited-minions-gif.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;There it is.&amp;nbsp; User error of course.&amp;nbsp; Working a treat now.&amp;nbsp; Thanks so much&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148945"&gt;@KhaledHassen&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 14:02:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1344964#M55599</guid>
      <dc:creator>LiamHarrington-Missin</dc:creator>
      <dc:date>2023-11-02T14:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Update hosted layer view definition w topfilter to show only most recent record</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1354457#M56122</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/148945"&gt;@KhaledHassen&lt;/a&gt;&amp;nbsp;This topFilter trick has been invaluable for me in various projects.&amp;nbsp; It's an especially neat trick for handling parade routes and the current location of various participants in the parade.&amp;nbsp; We use QuickCapture to stream point data to the underlying Feature Layer and then topFilter to limit it to the most recent feature.&lt;BR /&gt;&lt;BR /&gt;I have noticed something in my most recent project that I thought I might bring to your attention.&amp;nbsp; The "groupByFields" parameter seems to only work when the field provided is a text field.&amp;nbsp; I recently tried using a GUID field and the definition update simply would not take.&amp;nbsp; The moment I changed the groupByFields property to a text field, everything worked fine.&amp;nbsp; I have not experimented with other field types.&amp;nbsp; Is this limitation by design or simply a coincidence because of how topFilter is currently implemented on the backend?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 00:13:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/update-hosted-layer-view-definition-w-topfilter-to/m-p/1354457#M56122</guid>
      <dc:creator>FarmersBranchBrian</dc:creator>
      <dc:date>2023-11-29T00:13:52Z</dc:date>
    </item>
  </channel>
</rss>

