Activity and workout tagging

You can now add #tags to completed activities, planned workouts and workouts in your library. When an activity is paired with a planned workout then any tags from the workout are added to the activity. You can filter for activities by tag and search for workouts by tag.

Screenshot 2023-07-03 at 06.45.20

Planned workout on the calendar:

Screenshot 2023-07-03 at 06.45.56

Activity paired with a planned workout gets the tags:

Screenshot 2023-07-03 at 06.47.31

Edit activity tags using the activity name dialog:

Filter activities using tags:

17 Likes

This is absolutely fantastic. Thank you @david - the planned workout providing the tag for a completed workout if awesome!

People will now stop thinking Iā€™m trying to attempt be ā€˜coolā€™ by adding hashtags to the end of my ride names :grinning_face_with_smiling_eyes:

2 Likes

Perfect, I was just about to code this myself :wink:

Might it be possible that this code is similar enough to get us the option of setting gear for workouts and have it updated for paired activities too?

1 Like

For gear it would need to be set on the calendar event because library and plan workouts are not ā€œper userā€. And if you have to edit it on the calendar event you might as well just edit the activity instead. It would be better to support more activity types (e.g. MTB, Gravel etc.) and then add those to gear and select the gear that way. What is your use-case for this?

Okay, the calendar event makes sense.

For me itā€™s both a sport thing (which bike: gravel, road, tri) which isnā€™t completely tied to a sport type (tri and road would be the same?)

But also location. I have different running shoes in different locations, so depending on the weekday they change. Since Iā€™m planning workouts on to my calendar upfront I could already set the gear there and wouldnā€™t have to think after the workout.

Amazing! For years, both in Apple and garmin Watch I have always wanted to simply search between types of workouts such as zone 2 or intervals. Itā€™ll be much more enjoyable to look back and compare specific activities now :hugs::hugs:

2 Likes

great job @david

@david Have you considered adding support for ā€œconditional programmable tagsā€ for automatically classifying workouts?

I think this might be already possible by using Activity Fields with only true/false values but not sure if its one of its intended purposes.

E.g. I want to classify an activity as a Z2 run by looking at HR percentiles (instead of avg HR, for example).

It is possible using a custom activity field. Many of the standard fields on activity can be updated as a side-effect of the script processing, including the tags:

{
  // activity.tags will be null if there are none
  let tags = activity.tags = (activity.tags || [])
  if (tags.indexOf("foo") < 0) tags.push("foo")
}

Another example of this is a custom training load calculation. You can update activity.icu_training_load from the script.

1 Like

Ah wow! For some reason I assumed the activity object would be read-only and the only thing ā€œgetting outā€ would be the last expression of the script.

This is really cool - thereā€™s a lot of power in doing some custom post-processing.

1 Like

Not sure if it is something I am doing or a bug but I canā€™t filter out planned workouts by tag.

I have created some planned workouts and assigned the tag #warmup
I did the workout and the activity was paired with planned workout and the tag was assigned to the activity

If I use the filter Not #warmup to hide them, the activities are hidden but the planned workouts remain with a compliance to plan of 0%.


I can untick the plan box in the options but that hides all planned workouts and I only want to hide the ones with certain tags.

Am I missing something?
Nick

I donā€™t think youā€™re missing anything. It seems that the filter only applies to activities and not planned workouts. Iā€™m not sure if thereā€™s a specific reason for this as I agree that youā€™d mostly be looking to filter both on matching activities and planned workouts.

We can ping @david to get this on his radar as a feature request.

1 Like

Hi @david

Do you think this is something that could be easily implemented?

I have just implement this. The existing filter functionality now also applies to planned workouts. You a filter for tags but also other things that are present on planned workouts (e.g. moving time, type).

2 Likes

Thatā€™s great, thank you

1 Like

Hi,
where can I edit the tags-list?
image
br Steve

Not 100 % sure but I think that you need to remove unwanted tags from activities that have it. The ā€˜Tag Listā€™ is populated by any tag you ever used on an activity, itā€™s a listing of what is found in that database column.
Best way to remove certain tags is to filter in the activity List view, remove and add as needed.

1 Like

@david, I no longer have any activities with a specific tag, have re-logged and it still shows up in the tag list.

I made sure that no workouts in the library or in a training plan contain that tag. Also made sure that no charts are using that tag as a filter anymore.

I used it previously in charts and in workouts that got paired with activities. Maybe Iā€™m missing something, or maybe thereā€™s something on the backend that is holding on to that tag. Any idea on how I could troubleshoot further?

Tags on deleted activities are included in the list:

It doesnā€™t show that it has any tag.

Edit: I noticed you searched for the tag. Hereā€™s what I get when I do the same (extended date range):

In fact, searching for any activity name doesnā€™t seem to work for activities with the Deleted filter.