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
  • ...Continued

    I think 5+ is a lot more useful now. I was able to get the following formula working in up to 5 data fields (the 6th one crashes it tho *):

    SETV(1,SUM( ((1.01+((timer LT 300)*0.15 + (1- (NOT ((PREVT(Altitude,40) - Altitude) GT 16)))*0.12 - (timer GT 3000)*(HR LT 124)*0.12))*( (HR GTE 147)*(0.0013*HR*HR-14) + (HR LT 147)*(0.0002*HR*HR+0.054*HR+3) ) * (HR LTE 162 ) + 19*(HR GT 162))/ 3600)) ; ALERT ((GETV(1) MOD 1) LT 0.1) ; GETV(1)

    It's complex enough that AppBuilder 5 can barely handle it on a Fenix 5.

    I think with the formulas that most people are using, there shouldn't be too many problems.

    (*) Although there was no crash when I just put "Cadence / 2" in the 6th field.
  • Former Member
    Former Member over 6 years ago
    Again a nice addition and the error checking is also a welcome feature. Although incidentally seems it doesn't appear to like raw units with nested prevs.

    prev(prev(prev(prev(distance_raw)))) for example creates

    Error: Internal Error: TypeError: Cannot read property '0' of null


    Same thing happens with altitude_raw.

    Using raw units worked just fine on previous version though, any idea why it fails?
  • AppBuilder 5+ Update 1.1beta

    Well, it looks like I done goofed with the last update.... So I put back everything I removed just now.

    Now you can configure your fields with either text formulas or code from the web app. If you are using simple formulas, text works fine. More complex formulas (especially on multiple fields) will require code from the web app.

    Each field can take either a plain text formula or code from the web app -- either one will work.

    I also added back support for Edge 1000 and Oregon/Rino (lol). If you try to use code on a device which doesn't support it, you will receive the helpful error message "!NoCode".




  • JTH9 there was a problem in the web app, which is now fixed. Thanks for the bug report!
  • Update: AppBuilder 5 and 5+ (CIQ2)

    - Add prevn(x, n) function. Returns x from n seconds ago. Same options as timeavg() (strictWindow and pauseMode).

    Appbuilder 5+
    - Add 2 field layout.
    - Fix 4 field layout
    - Improve formula solving efficiency so *6* very complicated (300+ character) formulas can be used, when pasted in as code from the web app

    I said this before, but I'll prolly hit pause on appbuilder development for awhile, unless any bugs come up.
  • Former Member
    Former Member over 6 years ago
    It seems you took a head start adding PREVN, much appreaciated. :)

    Hopefully can put the new features to good use with some new working examples. I have a few ideas already, of course as always some of them they may not always work as planned in reality...
  • Former Member
    Former Member over 6 years ago
    Sadly seems PREVN doesn't yet appear to work. I get IQ! error if I use PREVN(Altitude, 5) for example. Or !Code if I use copied code. Nested PREVS still work fine though.

    EDIT: seems doesn't crash on AppBuilder5 though, so only happens on AppBuilder5+, even if PREVN is only on one field without any other code.
  • Update: AppBuilder 5+ (1.4beta)

    - Fix prevn() crash. Fix crash when entering certain functions (e.g. timeavg, prevd) as text formulas

    Thanks for the bug report.

  • Impressive App! Lots to learn!

    I've read the many posts related to power and am still confused. (I have a Stryd footpod with Stryd IQ and Stryd Power installed) I would like my 5S+ to display the average power of the last lap.

    I have tried many things with Appbuilder 5 including

    lastlap(lapavg(power))

    lastlap(lapavg(ifs(lapTime gte 30,timeavg(power,30,1)^4))^0.25)


    I get something, but it doesn't look like power.
    Any help from someone that already worked through this would be greatly appreciated.


  • cccrabbb I can't test this IRL as I don't have a Stryd, but you have to connect it as a generic power meter (in your watch sensor settings) to make running power available to other apps like AppBuilder. Otherwise, the Stryd is talking directly to the Stryd app and running power is not available to other apps.

    That's my understanding, anyway.

    Anyway, I did a quick test in the simulator and the power variable seems to work properly. I put debug code in, and it is definitely returning the currentPower activity info value defined in the Connect IQ API:
    https://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/Activity/Info.html#currentPower-instance_method

    I tried AppBuilder 5, 5+, and older devices [because sadly, those all take different paths through the code... In the simulator, this gave me a number around 170-200, which I guess makes sense for cycling power.

    Then I tried current power, lap power, and last lap power side-by-side. This one I only tested on AppBuilder 5 and 935, in the simulator. All 3 values looked pretty close together,when I pressed the Back/Lap button, lap power became last lap power.

    Finally I tried power next to lap NP and last lap NP:

    Lap NP remained blank ("--") until 30 seconds into the lap, as designed. After 30 seconds, I got a number close enough as expected to current power. When I pressed, lap, lap NP became last lap NP.