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
  • Hi,

    I'm trying to make a datafield that alternates between [elevation to destination] and [average grade to destination], but can't get it to work.

    code: if (timer mod 10 lt 5, elevationAtDestination_raw-Altitude_raw, 100*(elevationAtDestination_raw-Altitude_raw)/distanceToDestination_raw)

    Am I doing something wrong?


    Also a question: Are coursepoints-data also available as a variable? Looking for elevationAtNextCoursepoint and distanceToNextCoursepoint... :)

    Thanks !!
  • jimoestman 1) Looks okay to me. What happens if you display them individually or together, like:
    X + " " + Y
    where X is the first thing and Y is the second thing? It looks like there may be a Garmin bug here, unfortunately:
    https://forums.garmin.com/forum/deve...etodestination

    Should work fine once Garmin fixes it.

    2) DistanceToNextPoint and ElevationAtNextPoint should be what you’re looking for.
  • Hi again,

    You were too fastwith your response ;) Thank you and thank you for a great datafield.

    I was using navigation to a saved locations and it worked when choosing another location. Reason for not working initially; the elevation was not set on the first location. LOL So nothing wrong with your datafield.

    2) Coursepoints
    Waypoints and coursepoints are different and can be the same depending on how you use the navigation feature.
    Coursepoints are user defined points along the created course that can be given a name and a category such as summit, food, water, danger, etc. If you navigate a course with course points on a edge device you'll see list of these coursepoints with the distance from your location along the course. CAlled a cuesheet.

    It you don't use turn by turn navigation, on a device that does not have coursepoints in its datafield selection (such as on the sportswatches) coursepoints will be shown as waypoint. Like you say.
    But it you do use TBT nav. Next will always show elevation and distance to the next turn... and the course points gets lumped together and kinda lost with all the other 200+ waypoints.

    Apologies if you knew this already.

    Wish Garmin would include and elevate Course points to its own standard information (along with destination and waypoint) on all its devices that feature navigation. I've been longing for elavation to course points for years... and missed coursepoints on their watches.


    Cheers.
  • jimoestman no worries. Nah, it's just a coincidence.

    Thanks for the explanation. Nope, I didn't know all of that, although I know that on-device real-time TbT is different from TbT embedded in the course file, for devices without real-time TbT.

    Unfortunately, CIQ apps only have access to "distance to next point" and "elevation at next point". The SDK doesn't even specify exactly what "point" means. You'll find that the API abstracts and simplifies a lot of things on devices. Like military time is not distinct from 24-hour time, as far as the SDK is concerned.

    If you knew the distances and elevations at each point, you could embed that data in an ifs() function, but it would be ugly and the function would be probably quickly get too big for any platform except for 5+/5X/645M. Plus you'd have to enter the data manually which defeats the point. And of course it would only work if you followed the course exactly, with no detours.
  • Update: AppBuilder 5+

    2.4.1 Beta: Fix issue where spaces were displayed as boxes on Edge
  • So I get the feeling that people in this thread like running power, and people in this thread also like math formulas (hey, everyone has their thing).

    So I decided to combine the two and add AppBuilder to my Run Power field.

    Yup, if you have Fenix 5X, 5+, D2 Charlie/Delta or Descent MK1, you can enter up to two custom formulas in Run Power.

    https://forums.garmin.com/forum/developers/connect-iq/connect-iq-showcase/1435191-run-power-data-field

  • Former Member
    Former Member over 6 years ago
    Grade calculation

    SETV(1, IF(Speed_raw GTE 1, TIMEAVG((Altitude_raw - PREVN(Altitude_raw, 14)) / (Distance_raw - PREVN(Distance_raw, 14)) *100, 3), 0) )

    The watch internal altimeter isn’t exactly the most precise instrument on earth so had to go with quite a long time window with PREVN to keep the calculation stable enough, TIMEAVG,3 takes a bit of the rougher edges off (increasing TIMEAVG doesn’t seem to add much else than more lag). The altimeter can also apparently hover around 0,5 meters time to time (measured standing still). The altimeter also uses averaging so it takes ~10 seconds to settle. This is a lag that cannot be overcome, so the grade calculation will never be actually real time.

    Speed correction using polynomial curve fitting from Strava GAP https://medium.com/strava-engineering/an-improved-gap-model-8b07ae8886c3

    SETV(2, (0.0017 * GETV(1)^2 + 0.029 * GETV(1) + 1) * Speed_raw * 81 * 1.022)

    This should be pretty close fit for grades of -20% to 20%. What should be noted here that the last value is best left at 1 so grade of 0 would simply multiply by 1 = no correction.

    I hate to admit though, the pace is still a bit off compared to Strava averages. This is probably because they use a more aggressive grade calculation on site and some fancy filtering to remove the resulting noise.

    One might also wonder why numbers 81 and 1.022 at the end. This is the interesting part actually. What I did was a crude "power conversion" using my weight and a simple correction factor to match Stryd data. After this the total average power has been very close match to my Stryd power totals looking at my Stryd offline data after logging about 6 runs now. This is something worth experimenting so would be interesting to hear if it works for others too.