Export Google Fit Daily Steps, Weight and Distance to a Google Sheet

Updated on Monday, July 22, 2024

Comments Page 14

Return to post.



How can i add "com.google.body.fat.percentage.summary" ? I can't find the right dataSourceId

Robert Ellison

Jack - great, glad to hear it. Probably the problem with 60 days is not having enough data, try setting a smaller window. I don't have anything on heart rate. If anyone manages this please post!

Darren - I haven't seen duplicate rows recently but I have seen it happen. Looks like Apps Script maybe does an unexpected retry in some circumstances? If it's a problem it would be possible to check the last row in the sheet to see if the date is a duplicate or not.


Thanks Robert for all the help! Its getting there! It now works for me to pull just yesterday's data but the same error appears when I try to pull the past 60 days data. Would it be because I do not have yet 60 days worth of data?

On a separate note, one of the comments did try to write the script for heart rate, do you happen to have any updates regarding pulling both exercising Heart Rates as well as resting Heart Rates for this?

Your help is much appreciated!

Darren Wall

I've been running this script for about 6 months with minimal issues. I see multiple entries on 12th June having not messed with the scripts, has anyone else seen this?

Robert Ellison

Jack - that looks like it couldn't find the sheet. The script expects a sheet called Metrics for the daily update or History for the longer term pull. Make sure your spreadsheet is configured with the right sheets (or change the code if you want to call the sheets something else).


Hi, seems like I am struggling when going back to the sheets. Keeps coming up with errors. I tried redoing all the steps again but am faced again with a new error :

TypeError: Cannot read property 'appendRow' of nullDetails

Any help is much appreciated!

Robert Ellison

Jack - yes, it will warn you if not approved by Google, safe to ignore.


Thanks Robert for the reply. When trying to activate it on google sheets, seems like it detects it as an unverified app. Is that normal?

Robert Ellison

Jack - the redirect URL? Make sure you haven't left the { } characters in. You want to replace that entire segment with the script ID from apps script.


Hi, I am having issues with the URL (only have a URI option). It states that "The request failed because one of the field of the resource is invalid." Is there any way to get around this?

Add Comment

All comments are moderated. Your email address is used to display a Gravatar and optionally for notification of new comments and to sign up for the newsletter.