Yes. Re-analyzing an older activity clears the Custom Interval Field output values (Custom interval fields) from the interval tables ( activity/timeline page and activity /data page).
The Custom Activity Streams outputs (Custom activity streams with Javascript), streams.csv file and Custom Activity Fields output values (Custom activity fields) are not modified by reprocessing.
And for Custom Interval Fields allways keeping in mind that the last expression in the script is the value stored for the field.
I don’t use ‘let’ or ‘var’ etc.. as variables are implicitly declared. And the script is invoked once for each interval using the same sandbox and this fails if it declares fields.
If i do need to declare things i wrap the script in a block:
{
activity.average_stride * 2
}
As JavaScript code runs in a sandbox on the server when the activity is analysed.
All David’s style recomendations.