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
  • Yeah, two values works okay in 4-field layouts, but 3 is pushing it, although it's possible with HR/cadence if you use numbers and not decimals.

    Please note that to get the largest possible numerical font (with AppBuilder 5, not 5+), you need to limit your characters to:
    0123456789:.
    (and no spaces).

    It's a moot point with 3 values - which will already use a small font - but you might care if you have one or two values. Just adding a "W" or "bpm" sufffix will shrink your text.

    If you use other characters, the data field will automatically switch to a smaller text font, because as a simple data field, Appbuilder 5 lets the system handle the drawing (to save code space). This is why you see data fields in the store that use a "W" suffix for power and have teeny-tiny numbers. And that's why I recommended using a ":" separator even though it looks weird.

    This is a Connect IQ limitation where they don't want you to use characters that are not available in large numerical fonts, and they are slightly more restrictive than they need to be - "/" and spaces should def be supported. It's probably so they can support the widest range of devices - which all have different fonts - with the least amount of code.

    In AppBuilder 5+, you can use spaces and additional characters, like "/" and "#", and still get the larger numerical fonts, because 5+ - as a "complex data field" which handles its own drawing - controls the font that is used.
  • Having said that, multiple values in one field is a novelty but I dunno how practical it is - sort of like AppBuilder itself.
  • Update: AppBuilder 5 and 5+

    - Improve formula processing time so certain complex formulas don't crash (due to taking too long on init)
    - Fix recent bug where certain formulas would crash, regardless of complexity

    Here's where I say "my bad" and admit that sometimes I put pretty dumb code in AppBuilder in a fruitless attempt to save memory (even watches like 935 are starting to feel the crunch). I guess it started because to even create AppBuilder I had to write a bunch of pretty hard to maintain code that nobody in their right mind would write in an environment with more memory. Had I written clean code that was easy to maintain, I never would've been able to pack all these features into AppBuilder.

    Also, I could be better about testing, and also not releasing changes so rapidly. It needs to be useful, but it also needs to work.

    Sorry for the inconvenience!
  • I can imagine trying to shoehorn so many functions into a small memory space must be coding nightmare. As ever your efforts are appreciated.
    I was thinking of another function suggestion should it be practical... It may already be possible & I missed it.
    Currently I have two values displayed on a single data field in order to record one to the FIT summary & the other to the graph. I don't necessarily need to see the value that's graphed whilst riding but it's handy for post ride analysis. Is it possible to manipulate the formula for a value so it doesn't display but can be recorded to the appropriate part of the FIT file graph/summary/lapsummary.?
  • Former Member
    Former Member over 6 years ago
    If I've understood correctly, apparently if you put ; after the the first formula then it won't be displayed, and if you put +' '+ then both will be displayed. Works at least for recordsummary and recordlap, like I noted in my previous examples. Haven't tried myself with record and this is not in the examples, but would seem logical that it would work the same. If so, then you could try something like:

    recordsummary(avg(power)) ; record(power) ; hr

    Which would record power avg as total summary, record realtime power graph, and show some totally other metric during the workout.

    Stuff like this just makes you love AppBuilder and I don't know any other data field that can offer this kind of flexibility.
  • Brilliant. Thank you. I'll give it a whirl
  • Apologies for asking all these questions. I'm looking for a way to round a value down to the lowest whole number ie 20.1, 20.24, 20.5 or 20.75 etc would be rounded to 20. I see the ROUND(x) function will round to the nearest whole number not necessarily the lowest. I don't think I can use the FORMATNUMBER(x) function either as that seems to also perform rounding. Does anyone know if this is possible?
  • hotdogpartysausage No worries.

    If you want to round down, use:
    x div 1

    div is integer division, which rounds down.

    And yes, as JTH9 pointed out:
    x ; y = y
    and
    x ; y ; z = z
    and so on.

    The idea is that x may have "side-effects" (e.g. recording to FIT, alerting with a tone or vibe, setting a user variable), so the semicolon operator is there to let you have the side-effects of x while using y in calculations, display or recording.
  • Thanks guys, the RECORD & DIV examples worked a charm :D. This tinkering is getting a bit addictive
  • looking for a "Average Watts per Kilogram" cycling data field for Edge 820, (The garmin edge has a pre-installed Watts per Kilogram data field, I would like an average of that). Average Power in Watts from a power meter divided into body weight in Kilograms auto updating over duration of the ride, accurate to 2 or 3 decimal points eg 0.00 or 0.000 Thanks in Advance