Can a Feed Overwrite instead of Append?

321
3
12-21-2023 07:55 AM
EricBenson2
New Contributor

I have a small table with only 9 records, published as a web service, which stores a bus route, the number of the bus assigned to that route, and a last updated date field. The bus number assigned to a route can change daily. I want to join this table with my GPS feed based on the bus number so I can know which route each bus is performing.

I used the service to create a feed since just using the service as an input does not get updates unless the analytic is restarted. But a feed just keeps appending data, so over time as bus numbers change I get multiple possible bus routes that will join with any given bus number. I want my feed to only ever have 9 records in it, so there is only one possible record to join to each bus number. I essentially want the feed to be overwritten everytime it goes out to get an update from the service. Is that possible?

If that's not possible, then I think I have to filter my feed so that the join is only using the most recent dated record for any given bus route. I can't find any example arcade code though that would do that (and I'm not really a programmer, so I rely a lot on examples). But even if I do this successful, it seems very inefficient, having to do this filter with every incoming GPS record. If the feed would just contain the most up to date records, the analytic load would be way less.

Any help or suggestions would be appreciated! Thanks.

Tags (3)
0 Kudos
3 Replies
JeffEismanGIS
Esri Contributor

@EricBenson2 Thanks for the question. I'll message you directly so we can review your configuration. 

0 Kudos
JeffSilberberg
Occasional Contributor III

I believe you want to make sure the Track ID is the Bus Route and then make sure that the Feature Layer output uses the "Keep only the latest feature for each Track ID value" Option -   

Using the Feed to keep the Analytic current is the correct process as I understand it. 

If the Track ID does work, then you have to detect the change and fire a Web Hook / HTTP Output API Call,  that target code should use a Rest API to update the Feature layer in the Table -  I do this for several solutions. But maybe Jeff E. will have a better idea. 

 

 

JeffEismanGIS
Esri Contributor

@EricBenson2  I appreciate you jumping on a quick call to review your analytic. The issue was in the configuration of the incoming feed where the date field was not being read properly not allowing the analytic to know when a there was a attribute change.  The place to configure the time is in feed set up and is found outlined in red below.