Data Field: AppBuilder

By user request, this app lets you define your own data field, based on a simple math formula like cadence / 2.

If you want to get fancy, there's conditional expressions (like IF in Excel), functions for data analysis (like MIN and AVG), and the data field can also display the text of your choice. The resulting data can be (optionally) written to the activity FIT file.

With AppBuilder, you can implement almost any field that involves math, such as: calculating normalized power and saving the data to the FIT activity file, showing the average pace for even-numbered laps, or recording the amount of time you sprinted.

Full documentation and examples here:
http://ciq-appbuilder.blogspot.com/

AppBuilder 5:
Now with new features! AppBuilder 5 is a completely new app, so please check it out in the store if you are interested in any of the new features.
https://apps.garmin.com/en-US/apps/fd690281-9c22-4fee-a81e-3b7f39aa67c5

- Store up to four formulas per app. Switch between formulas directly on the watch, without using a phone or PC. With four clone apps, you can store up to 16 formulas total
- User variables. Allows for powerful formulas where information can be stored at one point, like the start of a lap, and used later. e.g. Lap elevation change
- Improved timeavg() options. Allows for simpler, more flexible normalized power function
- More functions and variables

4 clones of AppBuilder are available in the store, so you can have 2 formulas in the same activity
  • Former Member
    Former Member over 5 years ago
    Good news: It's already possible. For example Power +'/'+ HR or Power +' '+ HR if you want to use empty space instead of /as separator, or any other character you place between those apostrophes.

    With longer formulas again depends how much your device memory can handle. Also the font gets smaller when you add more values to same field.
  • To clarify what JTH9 said, if you want to have the largest font possible, I would recommend using ":" as a separator. This is due to technical limitations with "simple" CIQ data fields (which don't handle their own drawing) and font limitations across all devices.

    If you use any other separator, such as "/" or " ", then the font will automatically be smaller.

    Of course, if you are already placing AppBuilder in a field which doesn't have a lot of room, or you are planning to use 3 values in the same field, then go ahead and use a "/" or " ", since the font will shrink to fit anyway.

    But if it seems like the font could be bigger, try switching your separator to ":".

    For completeness, this is the full set of characters that will be displayed with the largest font possible, in AppBuilder 5 (spaces are not included):
    0123456789:.

    For AppBuilder 5+ (a "complex" data field which handles its own drawing), these are the characters which are available in large fonts (spaces are included, except for Edge):
    #%+-./0123456789:°
  • OK. Thanks much for help.

    For the Temperature. It's posible, in the future, with AppBuilder 5 have this information ?
    i have read before this topic but it seems that is not posible.
  • Former Member
    Former Member over 5 years ago
    FlowState Btw, do you know if there is any reason for following formula to not work. I mean at least based on recorded values it seems to work to calculate grade correctly and while on the run reaction time seems to change with speed. The idea is to use a variable time for Grade calculation so it will change depending on speed to give more stable values at lower speeds but react faster at higher speed.

    First it sets a variable for altitude, then it sets a second variable for time (to use with PREVN), and last it sets a global variable for grade.

    SETV(1, TIMEAVG((1-(rawAmbientPressure/1013.25)^0.19028)*44307, 8)) ; SETV(2, IFS(Speed_raw GTE 0, 14, Speed_raw GT 2.2, ROUND(33/Speed_raw)-1, Speed_raw GT 4.125, 7)) ; SETGLOBAL(1, IF(Speed_raw LT 1 OR Timer LTE 14, 0, (GETV(1) - PREVN(GETV(1), GETV(2))) / (Distance_raw - PREVN(Distance_raw, GETV(2)))*100))

    Second variable has a few limiters as otherwise especially at slower speeds it would crash (probably since PREVN is set too long and runs out of memory).

    Would appreciate any input if there is some technical reason for this to not work as otherwise I'm just wasting space with it. :)

    Also might have some other tricks to add stability, but still testing.
  • JTH9 The second argument to PREVN (time period / window), is supposed to be a constant. It won't work properly if you try to use a variable. Same goes for any PREV* functions or TIMEAVG (which PREVN is based on).

    I guess this is something that isn't explained in the docs -- sorry about that.

    For one thing, especially with PREVN and TIMEAVG, the number of samples is determined by the first call to the function, which allocates a fixed-size container. Even if you set the max value for the window for the first call, subsequent calls with a smaller window won't work properly, because the implementation assumes the window size doesn't change.

    A PREVN or TIMEAVG with a dynamic window size would really need to be a new function, IMO, since it would ideally have an argument for (max) window size as well as current sample "index". In other words, the function may have to collect more data than is actually used at any given second. Of course I would only be able to add it on the "cutting-edge" devices like Fenix 5X/5* Plus and 645 Music.

    Other than that, your formula is longer than 256 chars, so you can't use Garmin Express to configure it -- you have to use the mobile app. If you have an Android phone, I'd be curious to know what the string length limit is for Android GC app settings, as I am unable to test that myself. For iOS, it's practically unlimited, although there may be a practical app limit somewhere between 2048 and 4096 chars.
  • Former Member
    Former Member over 5 years ago
    FlowState Ok, thanks for confirming. Kind of suspected this. So even though it's now seemingly working (I'm using iOS to configure) it may not be working entirely right. Probably it just picks up 14secs then and keeps that?

    The longest formula I've tried is 348 characters (converted to code). It's basically the same formula, but sets a separate variable for each PREVN grade calculation ranging from 14 to 8 seconds with 2 seconds stepping. I could try an even longer version with 1 seconds stepping out of pure interest. Just to see how much the watch can really handle ;)
  • JTH9 well that would be the case assuming the first window value X you provide is larger than all the subsequent window values, except that you might get funny behaviour in the first X seconds. But if subsequent window values are larger than all bets are off. Really, neither function is designed to work with a variable window size and you should just assume they’re returning nonsense in that case, because there’s nothing reliable or consistent about the calculations in that case. The behaviour is “undefined”, technically speaking.

    I’ll update the docs when I get a chance.
  • Former Member
    Former Member over 5 years ago
    Ok, thanks again for confirming this. I'll go back to the longer version then.
  • JTH9 Other than that, your formula is longer than 256 chars, so you can't use Garmin Express to configure it -- you have to use the mobile app. If you have an Android phone, I'd be curious to know what the string length limit is for Android GC app settings, as I am unable to test that myself. For iOS, it's practically unlimited, although there may be a practical app limit somewhere between 2048 and 4096 chars.


    FlowState With Android GC i use formula about 380 chars. For now works fine!
  • Hi there,

    did anyone successfully write down a formula for TSS (training stress score)?
    TSS = (t * NP * IF) / (FTP * 36) = AppBuilder translation?

    Thanks!

    RM