Custom activity streams now support computing streams from fit file messages (not just record messages) using Javascript. Note that this cannot be used with the simpler “Record Field” streams but the process for creating the stream is the same:
Tick the “Processes fit file messages” box and create a script instead of entering a record field name.
This script just grabs the heart_rate data from the record messages:
{
for (let m of icu.fit.record) {
data.setAt(m.timestamp.value, m.heart_rate?.value)
}
}
Use the data array to record the stream. Note that you do not have to process only record messages. The fit object provides access to all messages in the file relevant to the activity.
The value can be a number (32 bit float) or an array of numbers or null.
You can maximise the window and run the script to see what it produces from the selected activity:
The streams are created when the activity file is processed. You need to reprocess existing activities to see new streams (Action → Reprocess file under the ride timeline chart or use the activity list view to do this in bulk).