Is it possible to bulk edit Workout Codes?

312 views
Skip to first unread message

perc...@gmail.com

unread,
Sep 22, 2021, 10:22:20 AM9/22/21
to golden-cheetah-users
This is probably obvious to most but having trouble figuring it out.
I would like to add a workout code "outdoors" for all my outdoor rides and another "zwift" for all my zwift rides.
I can filter my rides in the search box with "device = garmin" for my outdoor rides, but how do I then add the workout code to all of these filtered rides?
Thanks.

Ale Martinez

unread,
Sep 22, 2021, 10:31:28 AM9/22/21
to golden-cheetah-users

perc...@gmail.com

unread,
Sep 22, 2021, 11:28:24 AM9/22/21
to golden-cheetah-users
Thanks Ale, can you let me know where I should use this set function?
Also, would this be the correct syntax: 
set(Workout Code, "IRL", Device "Garmin Edge 500")

Ale Martinez

unread,
Sep 22, 2021, 11:37:53 AM9/22/21
to golden-cheetah-users
El miércoles, 22 de septiembre de 2021 a la(s) 12:28:24 UTC-3, perc...@gmail.com escribió:
Thanks Ale, can you let me know where I should use this set function?

In the filter box, as explained in the first part of that wiki entry, there is even an animation...
 
Also, would this be the correct syntax: 
set(Workout Code, "IRL", Device "Garmin Edge 500")

No

perc...@gmail.com

unread,
Sep 22, 2021, 12:09:41 PM9/22/21
to golden-cheetah-users
Sorry but I cannot get it to work.
I tried the following:

set(Workout Code, "IRL", Device "Garmin Edge 500")

set(Workout_Code, "IRL", Device "Garmin Edge 500")

set(Workout_Code, "IRL", Device = "Garmin Edge 500")

set(Workout_Code, "IRL", isset(Device)="Garmin Edge 500")

Ale Martinez

unread,
Sep 22, 2021, 12:21:26 PM9/22/21
to golden-cheetah-users
The third one is the only correct, it should work provided the filter part selects the right activities, you can test that separately.

perc...@gmail.com

unread,
Sep 22, 2021, 1:40:11 PM9/22/21
to golden-cheetah-users
The filter works as expected, but when I input:
set(Workout_Code, "IRL", Device = "Garmin Edge 500")
into the search field and press enter it just filters the rides and does not add the workout code.

Ale Martinez

unread,
Sep 22, 2021, 4:21:50 PM9/22/21
to golden-cheetah-users
El miércoles, 22 de septiembre de 2021 a la(s) 14:40:11 UTC-3, perc...@gmail.com escribió:
The filter works as expected, but when I input:
set(Workout_Code, "IRL", Device = "Garmin Edge 500")
into the search field and press enter it just filters the rides and does not add the workout code.

Workout Code field must exist, this will set the value but not create the field, additionally, If you are using v3.5, check Details tab. 

perc...@gmail.com

unread,
Sep 22, 2021, 4:59:12 PM9/22/21
to golden-cheetah-users
Workout code exists as seen in the attached screenshot.
I am using v3.6 dev

workout code.PNG

Ale Martinez

unread,
Sep 22, 2021, 5:47:42 PM9/22/21
to golden-cheetah-users
El miércoles, 22 de septiembre de 2021 a la(s) 17:59:12 UTC-3, perc...@gmail.com escribió:
Workout code exists as seen in the attached screenshot.

I mean the field definition in Fields tab
 
I am using v3.6 dev

Then check Data instead of Details chart. 

Steve Edmonds

unread,
Sep 22, 2021, 6:11:31 PM9/22/21
to golden-che...@googlegroups.com
--
I have this working in V3.6.
In my activities if I select the activity, Details tab and device it is filled with unknown.
In Details>Workout I have Workout Code is empty.

In the search box I change the option for search to filter and enter the following
set(Workout_Code, "muin", Device = "unknown") and press enter


The Workout codes in the Activities list all change to muin. I go to the main menu Athlete>Save all modified activities to save the changes to disc.

Ale Martinez

unread,
Sep 23, 2021, 9:52:53 AM9/23/21
to golden-cheetah-users
Adding !isset(Workout_Code) condition to the filter part is useful to avoid reprocessing older activities with Workout Code already set.

OTOH, if you want to automatically set Workout_Code that way on import, a default rule can be handy: https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Preferences_Data-Fields#defaults

I think we should add this to the FAQs since it comes back frequently.

Ale Martinez

unread,
Sep 23, 2021, 10:31:21 AM9/23/21
to golden-cheetah-users

perc...@gmail.com

unread,
Sep 23, 2021, 3:42:49 PM9/23/21
to golden-cheetah-users
I was able to get newly imported rides to work with setting up the default rule.
But was unsuccessful in changing the existing rides with the filter/search bar. 
set(Workout_Code, "IRL", Device = "Garmin Edge 500")

perc...@gmail.com

unread,
Sep 24, 2021, 2:52:19 PM9/24/21
to golden-cheetah-users
Okay i have finally got it to work - big thanks to Steve Edmonds for walking me through!
Oh boy do I feel like an idiot.  I did not realize that I should be clicking on the search icon to change it to the filter function.

It now works as expected.
Thanks Ale and Steve!

Probably clutching at straws here to save some dignity, but wondering if I was not using a dark theme would have helped me realize this sooner.

SS_goldencheetah-search-contrast.jpg

Ale Martinez

unread,
Sep 24, 2021, 6:15:35 PM9/24/21
to golden-cheetah-users
El viernes, 24 de septiembre de 2021 a la(s) 15:52:19 UTC-3, perc...@gmail.com escribió:
Okay i have finally got it to work - big thanks to Steve Edmonds for walking me through!
Oh boy do I feel like an idiot.  I did not realize that I should be clicking on the search icon to change it to the filter function.

It now works as expected.
Thanks Ale and Steve!

Probably clutching at straws here to save some dignity, but wondering if I was not using a dark theme would have helped me realize this sooner.

Or if you had looked at the wiki entry I posted in my first response, there is an animation explaining exactly that...

Dimitris

unread,
Nov 26, 2021, 4:53:54 AM11/26/21
to golden-cheetah-users
I can't seem to make this work. In v3.6, I change to Filters mode and enter set(Workout_Code, "myRun", Sport="Run"). Nothing happers. If I hover the mouse of the filter field there is a message "Sport is an unknown symbol". I then try with
set(Workout_Code, "myRun", Device="Garmin vívoactive 4") and I get "Device is an unknown symbol". Any ideas?

Ale Martinez

unread,
Nov 26, 2021, 6:22:08 AM11/26/21
to golden-cheetah-users
El viernes, 26 de noviembre de 2021 a la(s) 06:53:54 UTC-3, Dimitris escribió:
I can't seem to make this work. In v3.6, I change to Filters mode and enter set(Workout_Code, "myRun", Sport="Run"). Nothing happers. If I hover the mouse of the filter field there is a message "Sport is an unknown symbol". I then try with
set(Workout_Code, "myRun", Device="Garmin vívoactive 4") and I get "Device is an unknown symbol". Any ideas?

Check you Data Fields config  

Dimitris

unread,
Nov 26, 2021, 9:59:07 AM11/26/21
to golden-cheetah-users
Ok, I first had to create a "Device" field in the Categories section. I thought that it would parse the Device field that existed before in the Extra section. Interestingly, when I created the Device field in the Categories, the Device field in the Extra section was removed automatically.

Ale Martinez

unread,
Nov 26, 2021, 10:16:48 AM11/26/21
to golden-cheetah-users
El viernes, 26 de noviembre de 2021 a la(s) 11:59:07 UTC-3, Dimitris escribió:
Ok, I first had to create a "Device" field in the Categories section.

Device and Sport fields are included in default config, if they are not present and you didn't delete them, is likely you have a bogus config/metadata.xml file. This is current default config file: https://github.com/GoldenCheetah/GoldenCheetah/blob/master/src/Resources/xml/metadata.xml
 
I thought that it would parse the Device field that existed before in the Extra section. Interestingly, when I created the Device field in the Categories, the Device field in the Extra section was removed automatically.

Reply all
Reply to author
Forward
0 new messages