Computed activity fields

Can you check this activity? It seems like it does only calculate one of the custom fields. If I change the script to so it looks exactly like another one, the field will calculate that already has a “0” in it.

https://intervals.icu/activities/i8771586

Tx. I know whats wrong and am working on a fix. The scripts for an activity all run in the same sandbox instance so if you declare a variable with “let” and another script does the same, the 2nd script fails. You can workaround this by removing let:

temp_threshold = 38.4

Instead of: let temp_threshold = 38.4

1 Like

Great!! It solved all the metrics :smiley:

This is brilliant, thanks so much. I’ve added in running cadence (just a 2x of average_cadence) and running efficiency index (metres per minute per watt) as public.

Excited to see these added to fitness charts as well, I’ve actually been hacking the running efficiency index via wellness metrics :grimacing:

Also wondering – and this may already be true – will it be possible to write data to the stream as well? This would allow charting within the activity, which would be amazing.

4 Likes

Tx. I am going to be extending this to all parts of Intervals.icu including custom streams as soon as I can. I will be sorting out plotting custom activity fields on the fitness and compare pages today.

If anyone does want to declare stuff in the script wrap the body in a block:

{
   let factor = 2
   activity.average_stride * factor
}
1 Like

This functionality has been extended to interval fields:

1 Like

You can now plot custom activity fields on the fitness and compare pages. If there are multiple activities on the same day then values are combined according to the aggregate setting on the description tab:

Choose sum, min, max or average.

1 Like

How can we add these custom fields in the fitness page? When I try to add a plot I can’t find any custom fields

They are showing up for me at the bottom of the list. Remember that if you are viewing another athlete you need to add your fields to them first by going to one of their activities, clicking “Custom” and using the search button.

Apparently, it is not possible to update the activity streams currently. Being able to do that would enable a calculation of virtual power for runners based on pace :slight_smile:

I am going to add computed activity streams soon. Busy with computed wellness fields now.

5 Likes

Just trying out this new feature by looking at some of the examples ppl has shared.

When I export the FIT file, it doesn’t seems to have the “Work above FTP” Field. Has it been implemented or I’m looking at the wrong place?

(I tried using the FitSDK to do the convert to csv)

Can you please check on fitfileviewer.com. Thats what I used to test.

using FitFileViewer.com and I don’t really see any indication of it.

Here’s a screenshot on the activity page: The last number is the work>FTP
https://intervals.icu/activities/i11723746

Screenshot 2022-12-29 at 7.48.10 PM

Then I go to intervalData and click the Export FIT and open it in FitFileViewer.com. I don’t see any developer fields inside.

Should I be using the “Fit File” option or the “Original Fit File” option?

Only these 2 are available.

When I use the Original Fit File, I can see my Stryd Developer data inside, but when I use the “Fit File” these are stripped out. (Intervals.icu)

Aha. I was thinking of custom activity fields. I have just implemented support for exporting interval fields in the lap records.

I see it now… sorry about that…

TBH, i didn’t know/understand the difference between this and the Custom Activity Fields. (I was looking at this page Custom activity fields - #4 by Collin_Drake but wasn’t able to locate any fields to be used similar to the pic in that thread, but did find the Interval fields so I played w/ that instead)

NOw I found it…

Tx… all sorted.

1 Like

The naming of the buttons is unfortunate … but I didn’t want to rename “Fields” to avoid confusing longtime users.

1 Like

I got a little confused about all that to, so made a quick mental matrix: (needs to be updated for plots but haven’t found out yet)

Custom Field Type		Create/Config							Numeric Display 1						NumericDisplay 2				Plot 1		Plot 2
Custom Activity Field	Activity Page>Custom					Activity Page Summary					Activities List View Column		Fitness		Compare
Custom Interval Field	Activity Page>Fields					Activity Interval/Selection Summary		Activity Interval Data Column	TBD
Custom Wellness Field	Activities>Add Entry>Wellness>Fields	Activities>Wellness														Fitness		Compare
1 Like

@david, is there any limit for code lines number? I am thinking in preparing my own library of functions for whatever math tools that could be useful when I create any custom fields (or better, when this stuff is extendend to charts).

Nice! This is great. I’ve added some really valuable fields.

3 Likes