# Suggestion about tracking orders in SQL

**URL:** <https://discourse.nodered.org/t/suggestion-about-tracking-orders-in-sql/58596>\
**Category:** General\
**Created:** [18 February 2022 12:39 UTC](https://discourse.nodered.org/t/suggestion-about-tracking-orders-in-sql/58596 "2022-02-18T12:39:55Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [19 February 2022 12:54 UTC](https://discourse.nodered.org/t/suggestion-about-tracking-orders-in-sql/58596/14 "2022-02-19T12:54:53Z")

</div>

You could simplify the JSONata to

```auto
$append($flowContext("array")[$ != $$.payload], [$$.payload])

```

this wiill return the context array minus the incoming payload, then append the new payload to the end of the array, this also works well for arrays of objects.

this thread has some good examples of searching and appending to arrays with JSONata

> [@UI with selectable AIS ship target list](https://discourse.nodered.org/t/ui-with-selectable-ais-ship-target-list/46001):
>
> Hello, I am trying to create a Dashboard, where I can pick a ship/target from a drop-down list and display it's data... So far I set up a tcp:port where I receive AIS-NMEA data constantly. The "ais"-node transforms the data into readable json format (Objects?). The AIS data is sent every few seconds from several vessels (each has a specific time slot). If I want to select the data from just one special ship, l need to filter the incoming data, e.g. by ships name (or "mmsi")... ... additionall…

---

_[View the full topic](https://discourse.nodered.org/t/suggestion-about-tracking-orders-in-sql/58596)._
