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
  • RichardB you're welcome!

    I'm a little concerned about why the long formula doesn't work for you. Sometimes the forum can insert weird invisible characters that mess up a formula, but I double-checked and that's not what happened. Did you use Garmin Express or Android to set the formula? I only really tested the simulator (which should be similar to Garmin Express afaik) and iOS with a real watch. If you're happy with the short formula I guess it's not that important, but I'm curious.

    Sorry, dynamic colours for graphs are not possible with CIQ. All users of the same app are gonna see the same solid colour on their graphs.

  • Former Member
    Former Member over 6 years ago
    hi FlowState
    congratulation for this fantastic app.
    I try now to do little formula for calculate the avarge values of altitude.
    But now i have a dream ..
    Dream to calculate snapshot power in Watt without powermeter.
    It's posible ?
    wich formula ?

    many thanks

  • Good morning, i need to see my lap and current IF (intensity factor) while cycling (power from vector 3) and while running (power from stryd). I have an Edge 520 and a 935. Can someone help me? Is there an App or App builder code?. Thank you
  • Former Member
    Former Member over 6 years ago
    You could try: https://forums.garmin.com/forum/developers/connect-iq/connect-iq-showcase/1227689-data-field-appbuilder?p=1310631#post1310631

    In order to get IF you would simply need to divide normalized power with your current FTP, so I believe you would need to enter it like this:

    (AVG0(IFS(Timer GTE 30,TIMEAVG0(Power,30)^4))^0.25) / FTP

    for Lap IF:

    (LAPAVG0(IFS(LapTime GTE 30,TIMEAVG0(Power,30)^4))^0.25) / FTP

    Also make sure you configure the data field to display decimal (2 places) and write your current FTP as a number in the formula, otherwise it won't work.

    Hope this helps :)
  • You could try: https://forums.garmin.com/forum/developers/connect-iq/connect-iq-showcase/1227689-data-field-appbuilder?p=1310631#post1310631

    In order to get IF you would simply need to divide normalized power with your current FTP, so I believe you would need to enter it like this:

    (AVG0(IFS(Timer GTE 30,TIMEAVG0(Power,30)^4))^0.25) / FTP

    for Lap IF:

    (LAPAVG0(IFS(LapTime GTE 30,TIMEAVG0(Power,30)^4))^0.25) / FTP

    Also make sure you configure the data field to display decimal (2 places) and write your current FTP as a number in the formula, otherwise it won't work.

    Hope this helps :)




    Thank you! Seems works fine. Do you know if it’s possibile to do the same in running mode with power from stryd? Thank you
  • Former Member
    Former Member over 6 years ago
    Yes it's possible, but it's a bit of a hack to get it working.

    Normally in running mode native power data recording is not supported, but it can still be viewed if you have also paired your Stryd as a power meter in watch sensor settings. The reason you need to do it like this is that AppBuilder cannot read power data directly from Stryd IQ field which records the data to its own developer fields.

    Luckily the watch can have up to two IQ data fields, so you could have AppBuilder calculate IF from native power channel and additionally have Stryd IQ data field to display / record power to developer fields.

    Hopefully I could explain it so that it makes sense to you. It's a bit of a mess currently. It would be a lot easier if Garmin would simply support power in running mode natively.
  • Pretty big update for anyone who's still following this thread:

    - AppBuilder, and AppBuilder2-4 are now "AppBuilder Classic". I made a small update to change the app names and I have frozen development on those apps. The idea is that any formula which works today should work on those apps forever. The alternate clones are now identified with letters -- "B", "C", and "D" -- instead of numbers, because...

    - AppBuilder 5 has been released to the store!

    I put in some of the best suggestions, along with a couple of small ones.

  • New features [CIQ 2 only]
    • Local variables
    • Log and ln functions
    • New activity variables: distanceToNextPoint, distanceToDestination, elevationAtNextPoint, elevationAtDestination
    • And last, but not least:
      The ability to store multiple formulas and select them without a phone or PC

    AppBuilder 5 and its three clones are now available:
    https://apps.garmin.com/en-US/apps/f...e-3b7f39aa67c5
    https://apps.garmin.com/en-US/apps/7...7-dc2bcceb6fc2
    https://apps.garmin.com/en-US/apps/f...5-46dc1d939f3f
    https://apps.garmin.com/en-US/apps/3...d-dca71ea10b98
  • AppBuilder 5: New features
    Note: old CIQ1 devices (*) will not get any new features, due to severe memory constraints. For them, Appbuilder 5 is identical to AppBuilder Classic, but you do get four more configuration slots for your formulas.

    (* FR230/235, FR630, FR920XT, Vivoactive, Fenix 3/HR, D2 Bravo/Titanium, Quatix 3, Tactix Bravo)

    As always, please replace square brackets below with parentheses

    * Local variables

    SETV[index, value]
    - Sets the variable identified by index to value. Index is a number that identifies your variable. To do nothing, use NULL for Index -- this is useful in conditionals (see examples below)
    - Returns the same value that was passed in

    GETV[index]
    - Retrieves a previously set value from the variable identified by index
    - Returns NULL if SETV was not previously called for index

    Examples:
    https://ciq-appbuilder.blogspot.com/p/functions.html#fn_getv

    Unlike most programming languages, the arguments to IF are always evaluated, so the following will not work as expected (variable 1 will always be set to Timer):
    IF [Timer GT 3000, SETV[1, Timer], NULL]

    Instead, you want:
    SETV[1, IF[TIMER GT 3000, TIMER, NULL]]

    * Log/ln functions
    LOG[x, b]
    - Returns the log base b of x, or NULL if the result is undefined


    LN[x]
    - Returns the natural log of x, or NULL if the result is undefined

    * New activity variables: distanceToNextPoint, distanceToDestination, elevationAtNextPoint, elevationAtDestination
    Available on select CIQ 2 devices supporting full navigation, like 935 and Fenix 5. This should cover both course points and waypoints.

    Short forms: distpoint, distdest, elevpoint, elevdest

    Units:
    Distance: km or miles, depending on device distance units. Use _raw suffix for metres
    Elevation: metres or feet, depending on device altitude units. Use _raw suffix for metres

    * Store multiple formulas and select them directly on the watch

    The app now has 4 configuration profiles. The procedure for selecting a profile directly on the watch is:

    - Select a sport with AppBuilder on a data page
    - Double-click the START button before the activity starts -- or within the first 10 seconds -- to enter "config mode"
    - If the timer is now paused, AppBuilder will display "Press START". Press START to start the timer.
    - AppBuilder will now display the profile number and label: e.g. "1:AppBuilder"
    - Press LAP repeatedly to switch profiles
    - Double-click START again to save your changes. AppBuilder will display "Cfg Saved"
    - Discard the activity

    The next time you start AppBuilder, your new profile will be in effect.

    If you accidentally entered config mode or you want to lose your changes, no problem.
    - After entering config mode, just double-click START again, without selecting a new profile, and all will be well. You can even continue to the record the activity if you want. AppBuilder will have been computing and recording in the background, with the original formula.
    OR
    - Just discard the activity without double-clicking START

    - Note: the double-click window is a very generous 2 seconds. The normal window for double-clicking a mouse is half a second. I'm curious to hear feedback on this method. I know it isn't intuitive, but I can't think of any other way to configure a datafield without a phone....
  • More AppBuilder 5 changes which should make Normalized Power formulas simpler and more versatile.

    New options for TIMEAVG(), which takes the rolling/moving average of a value over time.

    (Please replace square brackets below with round brackets)

    TIMEAVG(value, X, strictWindow, pauseMode)

    - value: The value to be averaged
    - X: Size of the window, in seconds

    - strictWindow: (optional)
    0 (default): Does not wait until the sample window is full
    Returns an average even with the number of samples is less than the window size
    1: Waits until the sample window is full
    Returns NULL when the number of samples is less than the window size

    - pauseMode: (optional)
    0: (default): Reset data on pause
    When timer is paused, discards all samples (previous and current). Returns NULL
    1: Keep data during pause
    When timer is paused, keeps existing samples but does not collect new ones. Returns last known average
    2: Collect data during pause
    When timer is paused, continues to collect samples regardless. Returns the current average. This also applies to the beginning of an activity, before it has started. (But this can be overridden with a something like IF (Distance NEQ null)

    Note:
    TIMEAVG[value, X] is the same as TIMEAVG[value, X, 0, 0]

    Examples
    1) Normalized Power (native): Activity average
    Original formula:
    AVG0[IFS[Timer GTE 30 and [Timer - MAX[if [PREV[timer] eq null, timer, null]] plus 1] gte 30, TIMEAVG0[Power,30]^4]]^0.25

    New formula:
    AVG0[TIMEAVG0[Power,30,1]^4]^0.25

    2) Lap NP (native): Carries the rolling average over from prev lap
    LAPAVG0[TIMEAVG0[Power,30,1]^4]^0.25

    3) Lap NP: Resets at start of each lap
    LAPAVG0[IFS[LapTime GTE 30,TIMEAVG0[Power,30,1]^4]]^0.25

    These formulas all use a "strict window" which means that the average is not defined until you have a full 30 seconds of data.