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 6 years ago
    Here are the uphill / flat / downhill power formulas:

    Set global variable for Grade and display LapTime:

    SETGLOBAL(1, IF(Speed_raw GTE 1, (Altitude_raw - PREVN(Altitude_raw, 14)) / (Distance_raw - PREVN(Distance_raw, 14)) *100, 0) ) ; LapTime

    Set global variable for Uphill, Flat and Downhill Grade and display HR:

    SETGLOBAL(2, IFS(GETGLOBAL(1) GT 1.5, 1, GETGLOBAL(1) GTE -1.5 AND GETGLOBAL(1) LTE 1.5, 2, GETGLOBAL(1) LT -1.5, 3)) ; HR

    Display and record power. Show + for Uphill - for Downhill power:

    RECORDSUMMARY(AVG(Power),20) ; RECORDLAP(LAPAVG(Power),19) ; IFS(GETGLOBAL(2) EQ 1,'+', GETGLOBAL(2) EQ 2 OR GETGLOBAL(2) EQ Null,'', GETGLOBAL(2) EQ 3,'-') + RECORD(Power,7,"Power")
  • Former Member
    Former Member over 6 years ago
    Show and record Uphill, Flat and Downhill Lap Average Power. Also records total average:

    SETV(1, IF(GETGLOBAL(2) EQ 1, Power, Null)) ; RECORDSUMMARY(AVG(GETV(1))) ; NORECORD() ; RECORDLAP(LAPAVG(GETV(1)))

    SETV(2, IF(GETGLOBAL(2) EQ 2, Power, Null)) ; RECORDSUMMARY(AVG(GETV(2))) ; NORECORD() ; RECORDLAP(LAPAVG(GETV(2)))

    SETV(3, IF(GETGLOBAL(2) EQ 3, Power, Null)) ; RECORDSUMMARY(AVG(GETV(3))) ; NORECORD() ; RECORDLAP(LAPAVG(GETV(3)))
  • Former Member
    Former Member over 6 years ago
    If one wants to try these, they should definitely be converted to code first, otherwise will crash even on F5+.

    Also set correct format for each field so data is displayed correctly (Time for LapTime and Number for others) and remember to flip record switches for fields that record data.

    Since GC doesn't show the labels one might want to put the fields in some logical order. For example I would put them so that Power is first field, then Up, Flat and Down Power in fields 2, 4, 6, LapTime and HR with global variables in remaining 3 and 5 fields.

    Long labels won't fit so I used LapUPwr, LapFPwr, LapDPwr. For example.

    I'm 99% sure no one else will actually go through the trouble to actually try these. But still I think it's quite nice demonstration what you can do with AppBuilder. Might be interesting to substitute power with some other data too, so you could monitor uphill / downhill pace, RE, etc.
  • JTH9 that’s great, thanks! Just a reminder that the label will be recorded internally, so you can always download your original FIT and run it through the FitToCSV tool from the FIT SDK. It’s not so convenient but it allows you to recover that information at any point in the future.

    I wouldve liked to record the labels in the summary, like AppBuilder Classic/5, but unfortunately data fields have a pretty low limit on the amount of data to be recorded.

    Also for the record:
    Internal FIT developer field index:
    0-5 = fields 1-6 (graph)
    64-69: laps
    128-133: summary

    You would only need these numbers if you are not recording every field and you want to correlate internal fit fields to what you see in GC, and to the specific field index (1-6). OTOH they will always appear sequentially, so it’s not hard to figure out either way.

    In hindsight I should’ve gone with 1-6, 11-16, and 21-26, but too late now.
  • Former Member
    Former Member over 6 years ago
    Yeah, thanks for the info. At least SportTracks.mobi shows the labels correctly. Probably pretty much the only one that currently does.
  • JTH9 also here's some suggested simplifications (just less to type and think about). Note that I changed the meaning of the values for global var 2. -1 means downhill, 1 means uphill, 0 means flat, and null means unavailable.

    The original grade equation remains unchanged.

    Set the grade type and display HR:
    SETGLOBAL(2, IFS(GETGLOBAL(1) GT 1.5, 1, GETGLOBAL(1) LT -1.5, -1, GETGLOBAL(1) NEQ NULL, 0)) ; HR
    (If none of the IFS tests are true, the value is null)

    Record power and display sign:
    RECORDSUMMARY(AVG(Power),20) ; RECORDLAP(LAPAVG(Power),19) ; IFS(GETGLOBAL(2) EQ 1,'+', GETGLOBAL(2) EQ -1,'-', 1, '') + RECORD(Power,7,"Power")
    (Using "1" for the last IFS test is a trick for having a default value when none of your other tests are true)

    Display uphill, flat, downhill lap avg power:
    SETV(1, IFS(GETGLOBAL(2) EQ 1, Power)) ; RECORDSUMMARY(AVG(GETV(1))) ; NORECORD() ; RECORDLAP(LAPAVG(GETV(1)))
    SETV(1, IFS(GETGLOBAL(2) EQ 0, Power)) ; RECORDSUMMARY(AVG(GETV(1))) ; NORECORD() ; RECORDLAP(LAPAVG(GETV(1)))
    SETV(1, IFS(GETGLOBAL(2) EQ -1, Power)) ; RECORDSUMMARY(AVG(GETV(1))) ; NORECORD() ; RECORDLAP(LAPAVG(GETV(1)))

    (Same comment about IFS and the default value of null. It's just shorter.)
  • Yeah, thanks for the info. At least SportTracks.mobi shows the labels correctly. Probably pretty much the only one that currently does.


    If that's the case then at least you could set a longer internal label to be displayed on that site, while still displaying the short label on the watch. If you're curious why GC doesn't show the internal label, it's because they ask devs to set a fixed label in the app manifest. I'm pretty sure the reason is that the app manifest supports multiple languages, while the internal FIT label does not.
  • Former Member
    Former Member over 6 years ago
    FlowState thanks for tips with IFS. I agree simpler is better :)
  • These look great JTH9 just wish i knew how to get these working on a Appbuilder 5 for the Fenix5s, i suspect that it would not be possible?
  • Former Member
    Former Member over 6 years ago
    Unfortunately the answer is no.

    In theory it would be possible to rewrite the formula for two separate instances of AppBuilder 5. Another for displaying the 3 averages and another to display power with +/- sign and record it.

    But in practice you would never be able to copy the formula (will cut out even when converted to code) let alone run it on your watch (memory limit). I know as I still have my old Fenix5 and actually tried. :)

    I think this one is pretty much exclusive to AppBuilder5+ and Fenix 5+ series of watches.