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
  • Is it possible with AppBuilder to get the downhill distance and time of current lap, previous lap and in total?

  • I can get the downhill distance using

    sum( if (prev(altitude) gte altitude, distance - prev(distance), 0 ) 

    but I am stuck on resetting it for each lap. I tried with

    If(lapTime eq 0, setv(1, 0),setv(1, sum( if (prev(altitude) gte altitude, distance - prev(distance), 0 ) ))) ; formatdecimal(getv(1),2)

    I was hoping that this would reset the variable to 0 when a new lap starts (so when lapTime equals 0), but that didn't happen.

    What am I missing?

  • Try to use lapCount instead. I've used that in another case.

    , if( prev(lapcount) eq lapcount

  • Thanks. Unfortunately that gave me the same result. I suspect that it might have something to to with that note from the description of the AppBuilder if statement:

    (note: both trueValue and falseValue are always evaluated). 

    But I currently do not have another idea how I could reset a sum calculation for every new lap. 

  • Okay, now I had an idea. No need to clear the variable, i could just use a separate variable for each lap. This seems to work (but still need to test it in the wild another day, it's already close to midnight...)

    setv(if(lapTime gte 1,lapcount,null), sum(if(prev(altitude) gte altitude, lapdistance - prev(lapdistance), 0))); formatdecimal(getv(lapcount),2) + '/' + formatdecimal(getv(lapcount-1),2)

    It displays downhill distance of current and previous lap. At least I hope so...

  • Yes, that's would work. That's how I do it in this formula that show the 5 latest even lap paces.

    LapPace - even laps Appbuilder B - profile 1

    Display pace

    setv( findeqindex( lapCount, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37) +1, lapAvg( speed)); setv( 20, round( lapcount/ 2) div 1); record( lapcount mod 2 * 140 ); getv( getv( 20)) + " " + getv( getv( 20) -1) + " " + getv( getv( 20) -2) + " " + getv( getv( 20) -3) + " " + getv( getv(20) -4)

    1. Hi, I am just discovering this app and trying to set up data fields for my Instinct 2x.  What I want is avg w/kg and lap w/kg for cycling.  Two issues I'm having on the Instinct 2x, a minor one is it won't display the label.  But the biggest issue is anytime I use the power data value, as in lapavg(power) I get a !Name error.  Current w/kg is available out of the box, but not the averages, I would think the Instinct 2x is considered multi sport, so power values would be available.  Even if I just make a formula that is just power, I get the !Name error. It looks like a great app I hope i can figure it out!
  • Does anybody know how the recording to fit file works? 

    I tried to add "recordlap(getv(lapcount),9);" to my code. I expected that this will overwrite the lap distance with my calculated lap distance. But it does not do that. In Garmin Connect I still see the lap distance as originally recorded from my Fenix 7x SS. Did I misunderstand how this function should work?

  • You can not record to native fields, only to new developer fields.

  • Thanks, then I misunderstood the meaning in the description ("This allows you to override native fields such as Power on 3rd-party sites.").

    Still I would like to understand what I can do. What are these "new developer fields" that you were mentioning? And where can I find the values after recording to these?