DEV Community

G Oh
G Oh

Posted on

Export Mi Band 5 data from Mi Fit to Google Sheets

Liquid syntax error: Unknown tag 'endraw'

Top comments (5)

Collapse
 
zont_zo_it_x profile image
midas

Thanks for sharing! I am looking to use this for a school project. Problem is, I am getting this error after trying to sync in google sheets:

TypeError: Cannot read property 'tp' of undefined

Do you have any idea how I can fix this?

Collapse
 
palms profile image
Guilherme Palmerio

Found it!

The error you're encountering indicates an attempt to access the 'tp' property of something that is undefined. In your code, this happens on the line where you try to access element.summary.pai.tp:

Change:
var totalPai = element.summary.pai.tp;

To:
var totalPai = element.summary.pai && element.summary.pai.tp ? element.summary.pai.tp : '';

Apparently, the element.summary.pai object is undefined in some cases, leading to the mentioned error. To fix this, you can add checks to ensure that the properties are present before accessing them.

Collapse
 
farwamehmood1421 profile image
FarwaMehmood1421

Hey, G Oh. While sync-ing the sheets I am getting the error:

TypeError: Cannot read property 'user_id' of undefined.

Kindly fix the problem for me.

Collapse
 
npocean profile image
npocean

Good day! For some reason the heart rate data doesn't show. Would you happen to have any idea why this is happening? Thanks!

Some comments may only be visible to logged-in visitors. Sign in to view all comments.