This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Garmin Connect Activity Sorting

I want to sort my activities by various criteria - pace, distance, elevation, etc. But activity sorting using the column arrow keys does not work correctly, sorting seems haphazard. I raised with Support who said that the app does not support sorting. I find that hard to believe. 

Why then are there up/down arrows on each column if they don't sort by that column?
Why does row ordering change when I click on an arrow?
Why do the following urls appear when I click on the up/down arrows (note sortBy and sortOrder values)?
The only reason I would use the web app is to rank my activities by various criteria e.g. longest cycle, quickest run, steepest elevation, highest HR, etc. Everything else can be done on the device. What else is the point of the web app?
I believe there is sorting in the app, it is just not working correctly. But Online Support begs to disagree.
Can anyone advise?
  • Hi Alan. Yes things are a bit confused at Garmin on a number of levels, below is the last email on this I received from them on 18/12/20. This is of course totally at odds with what you were told about sorting never existing in the app!

    Hi Mark,

    We have added you into an open investigation which will be used to determine the cause of this issue which we are looking into currently. Using the information provided they will test and reach a suitable resolution which will then be supplied to you directly by email.

    We cannot provide a time frame for this process as it depends on what is discovered during the investigation and what is required to resolve the issue.

    Any updates will come to you directly via email as an affected user of this case.

    Kind regards,

    Anthony

    Garmin Europe

  • you were told about sorting never existing in the app

    ... and that's true. Sorting never existed in the app (the Garmin Connect Mobile app). It only existed in the web interface (Garmin Connect Web). So if you had them investigate the app, then their answer is not surprising.

  • Well ok, but after finding where is the problem and that it's technically a minor, everybody can easily fix it with add-on, while waiting for actual fix, something like that:

     

    manifest.json:

    {
      "description": "Sort Connect's JSON.",
      "manifest_version": 2,
      "name": "sort-connects-json",
      "version": "1.0",
    
      "permissions": [
        "webRequest", "webRequestBlocking",
        "https://connect.garmin.com/*" ],
    
      "background": { "scripts": ["background.js", "lodash.min.js"] }
    }

     

    lodash.min.js:

    library used for sorting in my add-on, download from official website.

     

    background.js:

    chrome.webRequest.onBeforeRequest.addListener
    (function(e)
        {var
            url = new URLSearchParams(e.url),
            f = browser.webRequest.filterResponseData(e.requestId),
            dec = new TextDecoder('utf-8'), enc = new TextEncoder(), data = [];
            f.ondata = event => {data.push(dec.decode(event.data, {stream: true}));};
    
            f.onstop = event =>
            {   var j = JSON.parse(data.join('')),
                sortBy = url.get('sortBy'),
                sortOrder = url.get('sortOrder');
    
                j = _.orderBy(j, sortBy, sortOrder);
    
                f.write(enc.encode(JSON.stringify(j)));
                f.close();
            };
    
        },
        {urls: ['https://connect.garmin.com/modern/proxy/activitylist-service/activities/search/activities*']},
        ['blocking']
    );

     

    Some URL parameters are named differently then JSON, so before actual sorting: j = _.orderBy() - add translation:

    // Replace URL names by JSON names
    r = {'startLocal' : 'startTimeLocal',
         'name'       : 'activityName',
         'avgSpeed'   : 'averageSpeed',
         'avgHr'      : 'averageHR',
         'maxHr'      : 'maxHR'}[sortBy];
    if(r) {sortBy = r;}

  • Hi Trux, I made it clear to Support I was referring to the web only (I called it the web app as against the device app). This is the response I got, perhaps not exactly how I described it earlier, they said it only sorted by date. Previously they thought I was referring to filters. I sent a detailed response, will look forward to their next response.

    Hi Alan,

    I can confirm this is not an issue but the way Garmin connect is designed. 

    Activities will display from the most recent activity performed and continue down until the very first activity completed.

    Newest > Oldest. 

    The attached screenshot will show the only filters avalible on Garmin connect (web only). 

    What you are looking for is not something we have avalible and would be more of a feature request. 

     We cannot guarantee that what you have suggested will be implemented, however we do appreciate you passing along your opinions. Please share your ideas with us at the following page on our website: http://www8.garmin.com/contactUs/ideas/

    Kind regards,

  • Looks like you had the bad luck in falling on someone new in the Support, knowing nothing about GC Web, and not being even able to open the page in his own account and testing it. You should have insisted on escalating the case to a higher level support, because that guy was apparently incompetent to even log it.

  • Ha ha nice JSON and Javascript , perhaps you should sell it to Garmin Slight smile I think I'll just carry on using the exported CSV file in Excel until they implement your solution.

  • The sort seems to be working properly now.

  • It certainly seems to be, that's great, our persistence paid off :).