FitContributor displayInActivityLaps output values of #VALUE?

Working with FitContributor and trying to have session lap information displayed.

I have defined the Resources file as :

<fitContributions>
    <fitField id="0" displayInActivityLaps="true" sortOrder = "0" precision="2"
        chartTitle="@Strings.RE_Graph_Label" dataLabel="@Strings.RE_Label"
        unitLabel="@Strings.RE_Units" fillColor="#FF0000" />
</fitContributions>

The relevant line for setdata is also put in place when onTImerLap is triggered.

I have verified the resultant FIT data (converted to CSV) and the lap triggered values are also there in the Fit File.

However, monkey graph shows nothing except for ?VALUE# for the laps tab.

I have tried doing a a displayInChart=true and this data does come out in MonkeyGraph. I have no clue why this is happening. The data is the same eg: 1.22 / 1.55 / 3.22 etc

What am I doing wrong?

  • After more head banging.. Managed to get the values visible on Garmin Connect Mobile (IOS) but the values are missing in Garmin Connect Web. In fact, Garmin connect web seems to have the columns doubled up and mixed up.

    MonkeyGraph still shows ?VALUE# as the output

    I managed to get the values visible in GCM by putting setData() into compute() whereby it gets called and updated every second as opposed to previously I just put it on onTimerLap() where it gets called and will update when a Lap press is detected.

    In The programmer's guide this was written : If you are creating a Record (graph), you should update this value once a second. For lap and summary, you should provide constant updates to the current lap or workout value for the metric.

    I am not creating a graph but a MESG_TYPE_LAP but how come i still need to update it every second? Is this what is meant by "constant updates to the current lap"?

    How is everything actually doing these FitContributor of type LAP?

  • Trawling the forum - I found this little nugget from 3 years ago..

    https://forums.garmin.com/developer/connect-iq/f/discussion/3763/fit-contributor/33062#33062

    By the way: I put this code in the onTimerLap() method, nevertheless, it seems that the fit file is written __before__ this code is executed which means that the data is written to the next lap :-( Is this a bug or a feature and is there a workaround for this?



    Maybe you've figure this out in the meantime, but thought I would add, in the API docs for onTimerLap(), it states:

    This notification is fired after the lap record has been written to the FIT file


    Therefore, this behaviour is expected. The workaround is to (repeatedly) call setData() on your field during the current lap (e.g. in compute()) – see the MoxyField example, this does the same. Since your field is MESG_TYPE_LAP, the message is only written to the FIT once. You could think of it as being continually overwritten with the latest, so that when the lap ends, the data is up-to-date.

    I guess this is the reason? But it still should not 1) display ?VALUE# in MonkeyGraph and 2) be visible in Garmin Connect Mobile but not on Garmin Connect Web