Using the realtimetrains.co.uk API I can get a JSON formatted list of the next 50 (or less) trains to stop at / pass my local station.
So msg.payload.services is an array containing various fields of interest, eg
msg.payload.services[n].locationDetail.origin[0].description (From Birmingham)
msg.payload.services[n].locationDetail.destination[0].description (To Liverpool Lime Street)
msg.payload.services[n].locationDetail.gbttBookedDeparture (Due departure time)
msg.payload.services[n].locationDetail.realtimeDeparture (Expected departure time)
etc.
What is the best way to extract those data from the array and display them on the dashboard as a departures board?
loop through msg.payload.services entries and generate an array of objects containing key/val properties you want displaying and send it to a ui template or a ui table node for display.
e.g. if you loop that data source and generate the below format & drop it into msg.payload