# Custom activity fields

**URL:** <https://forum.intervals.icu/t/custom-activity-fields/25515>\
**Category:** Uncategorized\
**Created:** [18 December 2022 13:30 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515 "2022-12-18T13:30:18Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [5 March 2025 14:15 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/21 "2025-03-05T14:15:44Z")

</div>

Not directly (yet). However you can display the value from any /fitness page plot on the calendar. And you can plot custom activity fields on the /fitness page.

> [@Add custom fitness plots to the calendar](https://forum.intervals.icu/t/add-custom-fitness-plots-to-the-calendar/55299):
>
> Values from plots on custom charts on the /fitness page can now be added to the calendar. In this example I have added a custom chart showing work done per day (kJ) and the total for each week: To display this data on the calendar click the dot dot dot menu and tick the “Show on calendar” box. Then choose where and how it should be displayed. In this case the Sunday value is displayed in the weekly summary area and in the week popup.

---

<div class="post-metadata">

**Author:** ![PiotrekNL](https://forum.intervals.icu/user_avatar/forum.intervals.icu/piotreknl/32/52092_2.png) [@PiotrekNL](https://forum.intervals.icu/u/PiotrekNL)\
**Post date:** [5 March 2025 14:30 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/22 "2025-03-05T14:30:15Z")

</div>

I am using a custom field on the whole activity by taking power (for cycling) via:

> streams.get(“fixed\_watts”).data

This works but it would be very nice to have the value calculated for a chosen part of the ride as well (when I mark part of the activity). This works for a default field “Average power” for example.

It’s probably very basic question, I could answer it myself if there was a way to see the code used to calculate default fields. Is that possible? It would make tinkering with things easier as one could just copy-paste the code and then edit it for their needs.

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [5 March 2025 15:21 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/23 "2025-03-05T15:21:23Z")

</div>

The default fields are all calculated in Java (very fast) whereas the custom ones are done in Javascript running in a sandbox (much slower but safe to run untrusted code). I can post Java fragments of specific things.

You can create custom interval fields to compute things for parts of an activity. These are also computed when you zoom on the timeline chart and displayed top left. So that might handle your “part of the activity” requirement.

> [@Custom interval fields](https://forum.intervals.icu/t/custom-interval-fields/25942):
>
> Intervals.icu now supports custom fields for intervals. You can enter the values manually (e.g. from a test of some kind) or compute them using JavaScript code. Click “Fields” on the activity timeline page and then “Add Field” to create a new field or search for an existing field: Note that the fields are specific to the athlete being edited. So if you are coaching people, create fields for yourself and then use the search button to add copies to your athl…

---

<div class="post-metadata">

**Author:** ![intervalsftw](https://forum.intervals.icu/user_avatar/forum.intervals.icu/intervalsftw/32/33184_2.png) [@intervalsftw](https://forum.intervals.icu/u/intervalsftw)\
**Post date:** [5 March 2025 15:35 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/24 "2025-03-05T15:35:53Z")

</div>

Could it be a feature request to add a field for lacate? Most runners I know take a lactate measurement during each workout, which for many translates to 3-6 workouts a week besides long/easy running. Having the lacate displayed on the calendar view like pace, GAP, etc. would be a great enhancement for runners. It could be something as simple as the feel parameter, where you just input “x.xx”, and at which interval you measured it.

Lactate: 2.0mmol  
Measured at: 4th interval

---

<div class="post-metadata">

**Author:** ![app4g](https://forum.intervals.icu/user_avatar/forum.intervals.icu/app4g/32/41800_2.png) [@app4g](https://forum.intervals.icu/u/app4g)\
**Post date:** [5 March 2025 15:38 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/25 "2025-03-05T15:38:01Z")

</div>

sounds like this can be a custom wellness field capture?

---

<div class="post-metadata">

**Author:** ![intervalsftw](https://forum.intervals.icu/user_avatar/forum.intervals.icu/intervalsftw/32/33184_2.png) [@intervalsftw](https://forum.intervals.icu/u/intervalsftw)\
**Post date:** [5 March 2025 15:43 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/26 "2025-03-05T15:43:03Z")

</div>

It should be related to the activity imo. You can also take multiple readings in one workout. Would also be great in compare view for the same workouts. For many runners lactate is a much more important measurement compared to for example HR. The norwegian model for example soley base itself on lactate readings. Most of the runners I know/follow take a picture of the lactate reading and post it on strava to log the measurements. If intervals.icu would support logging and displaying it, that would be extremely useful.

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [5 March 2025 15:50 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/27 "2025-03-05T15:50:00Z")

</div>

I have “editable sparse custom activity streams” on the todo list. Like the current custom streams but supporting sparse streams (only a few points) with UI to edit for manual capture (+ CSV upload and so on).

---

<div class="post-metadata">

**Author:** ![intervalsftw](https://forum.intervals.icu/user_avatar/forum.intervals.icu/intervalsftw/32/33184_2.png) [@intervalsftw](https://forum.intervals.icu/u/intervalsftw)\
**Post date:** [6 March 2025 07:18 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/28 "2025-03-06T07:18:13Z")

</div>

Sounds great. Considering how wildy used it is I would consider adding it as a “standard” field for all users, but as long as I can record it I am happy 🙂

---

<div class="post-metadata">

**Author:** ![Nicola\_Cardaci](https://forum.intervals.icu/user_avatar/forum.intervals.icu/nicola_cardaci/32/39710_2.png) [@Nicola\_Cardaci](https://forum.intervals.icu/u/Nicola_Cardaci)\
**Post date:** [6 March 2025 07:35 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/29 "2025-03-06T07:35:38Z")

</div>

Hello!  
I created 6 custom fields to calculate the work done in each zones; but in the custom chart the “100% stacked bar chart” isn’t displayed. for sure i’m missing something.  
Here the code for Z1:  
pData = streams.get(“fixed\_watts”).data;  
ftp=activity.icu\_ftp  
pZones = activity.icu\_power\_zones;  
z1min = 0  
z1max = ftp\*(pZones[0]/100);

joules = 0;  
for (let w of pData) {  
if (w \>= z1min && w \< z1max) {  
joules += w;  
}  
}  
joules / 1000;

Thank you for help

---

<div class="post-metadata">

**Author:** ![Jordi\_S](https://forum.intervals.icu/user_avatar/forum.intervals.icu/jordi_s/32/51042_2.png) [@Jordi\_S](https://forum.intervals.icu/u/Jordi_S)\
**Post date:** [13 April 2025 17:56 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/30 "2025-04-13T17:56:07Z")

</div>

How can we create a custom bar chart with 100% stacked bar displayed? no displays this option un custom values within custom % values.

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [21 April 2025 09:14 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/31 "2025-04-21T09:14:07Z")

</div>

I have finally got this done. Click the dot dot dot button next to the plot:

 ![Screenshot 2025-04-21 at 11.10.27](https://forum.intervals.icu/uploads/default/original/3X/a/5/a5b1bf8a71126272ee8efde24551a80b59fb1249.png)

Then change the stack field from blank to whatever you like to make the bars stack. You can edit the field and do not have to pick from the drop down.

 ![Screenshot 2025-04-21 at 11.10.46](https://forum.intervals.icu/uploads/default/original/3X/c/2/c28f78f5146b8321d8cb7b4bb8bb6d72685fdf39.png)

This works for custom and build in fields.

---

<div class="post-metadata">

**Author:** ![Jan\_T](https://forum.intervals.icu/user_avatar/forum.intervals.icu/jan_t/32/52795_2.png) [@Jan\_T](https://forum.intervals.icu/u/Jan_T)\
**Post date:** [18 June 2025 13:04 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/32 "2025-06-18T13:04:14Z")

</div>

Absolutely love the custom activity fields, maybe the most powerful tool ever developed in this space. Potentially a stupid question but is there a library or glossary of all the variables and streams available? Searched for it and could not find any reference, and guessing the name of variables only got me so far…

---

<div class="post-metadata">

**Author:** ![app4g](https://forum.intervals.icu/user_avatar/forum.intervals.icu/app4g/32/41800_2.png) [@app4g](https://forum.intervals.icu/u/app4g)\
**Post date:** [19 June 2025 06:58 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/33 "2025-06-19T06:58:59Z")

</div>

> [@Server side data model for scripts](https://forum.intervals.icu/t/server-side-data-model-for-scripts/25781):
>
> The documentation in this post has been replaced by an npm package with Typescript interfaces etc. for the data model.

check tat

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [12 September 2025 07:15 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/34 "2025-09-12T07:15:38Z")

</div>

You can now add these to sports:

> [@Custom activity fields on sports](https://forum.intervals.icu/t/custom-activity-fields-on-sports/111867):
>
> It is now possible to add [custom activity fields](https://forum.intervals.icu/t/custom-activity-fields/25515) to sports in /settings: The “Select” button opens the field selection dialog: These are copied onto new activities and onto existing activities without a value for the field when they are analysed (like FTP and the other built in settings). This is useful for storing the results of lab tests etc.. You can use these values in calculations for other custom activity fields and streams, …

---

<div class="post-metadata">

**Author:** ![Running\_Dude](https://forum.intervals.icu/user_avatar/forum.intervals.icu/running_dude/32/63432_2.png) [@Running\_Dude](https://forum.intervals.icu/u/Running_Dude)\
**Post date:** [20 October 2025 15:42 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/35 "2025-10-20T15:42:41Z")

</div>

I am sure this was asked before, but I can’t find it. I like the VO2max custom fields, but I have a few activities that are shorter than 5min that have totally unrealistic numbers for vo2max.  
I would like to filter those activities in the script by only compute a value if the whole activity is longer than 5 minutes.  
Any suggestions?  
Many thanks.

---

<div class="post-metadata">

**Author:** ![R2Tom](https://forum.intervals.icu/user_avatar/forum.intervals.icu/r2tom/32/50144_2.png) [@R2Tom](https://forum.intervals.icu/u/R2Tom)\
**Post date:** [20 October 2025 15:50 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/36 "2025-10-20T15:50:40Z")

</div>

> [@Running\_Dude](#):
>
> I would like to filter those activities in the script by only compute a value if the whole activity is longer than 5 minutes

Just put an if statement around your script:

> if(icu.activity.elapsed\_time \>= (5 \* 60))  
> {  
> // script here  
> }

---

<div class="post-metadata">

**Author:** ![Running\_Dude](https://forum.intervals.icu/user_avatar/forum.intervals.icu/running_dude/32/63432_2.png) [@Running\_Dude](https://forum.intervals.icu/u/Running_Dude)\
**Post date:** [20 October 2025 16:35 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/37 "2025-10-20T16:35:26Z")

</div>

Thanks!  
Edit: but if I understand the functionality of this if clause right, then it computes only a value for the VO2max, after 5min in the activity.  
Say I have a 20min long run, does it only compute the last 15minutes?

Maybe I am wrong, but If I only want to exclude the short workouts, would it not be better to check the whole duration of the activity and break the script when it is shorter than 5 minutes.

Maybe your suggestion does exactly this. Than sorry for questioning…

---

<div class="post-metadata">

**Author:** ![MedTechCD](https://forum.intervals.icu/user_avatar/forum.intervals.icu/medtechcd/32/40383_2.png) [@MedTechCD](https://forum.intervals.icu/u/MedTechCD)\
**Post date:** [20 October 2025 16:47 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/38 "2025-10-20T16:47:44Z")

</div>

The statement simply checks if the total elapsed time is more then 5 min. If this is not the case, the script will not run.

---

<div class="post-metadata">

**Author:** ![Coach\_Nissan](https://forum.intervals.icu/user_avatar/forum.intervals.icu/coach_nissan/32/70458_2.png) [@Coach\_Nissan](https://forum.intervals.icu/u/Coach_Nissan)\
**Post date:** [5 January 2026 13:16 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/39 "2026-01-05T13:16:15Z")

</div>

This is awesome, although I can’t seem to have it backfill for all my previous activities, I am trying to look at xEFF for running GAP/HR essentailly, and when I got to previous activities, I can’t see the new metric I made?

---

<div class="post-metadata">

**Author:** ![R2Tom](https://forum.intervals.icu/user_avatar/forum.intervals.icu/r2tom/32/50144_2.png) [@R2Tom](https://forum.intervals.icu/u/R2Tom)\
**Post date:** [5 January 2026 13:34 UTC](https://forum.intervals.icu/t/custom-activity-fields/25515/40 "2026-01-05T13:34:57Z")

</div>

You have to reanalyse old activities.  
From inside an activity try Actions \> Analyse  
For Bulk Action Goto the Activity List, then select all old activities and do it from Edit \> Analyse

[Previous page](https://forum.intervals.icu/t/custom-activity-fields/25515.md?page=1)

[Next page](https://forum.intervals.icu/t/custom-activity-fields/25515.md?page=3)
