Help with splitting text shortcut (old fitbit data to Apple Health)


I try to import my old fitbit-data into Apple Health via Shortcuts-app.

The data is stored as plain text, like this (i change the separator to #, instead of ,):


After loading the file, i use ‘Repeat with Each’ - ‘Split Text / New Line’ and ‘Split Text’ with Custom Separator #. How do i access the different elements of a line (date, weight, bmi, fat)? If i use ‘Get Item from List’ - i got an error message if i use an Index higher than 1.

Then i can log the different elements of each line to the correct place in Apple Health.

Thanks for you suggestions. :+1:

You haven’t shared your shortcut, so it’s nigh on impossible to debug. Maybe this example will give you something to work with?

Hope that helps.


You should split in lines first and then repeat with each line: example.

1 Like

@hoppel indicated they were already splitting by new line and custom separator. There’s something about their use of the Get List Item that’s in question, though I guess it could be around the nesting of splits/repeats that could be the underlying issue.

It was just a question, don’t shared my shortcut because it is a very basic one without function.

Thanks for your examples, i will lock into them.

@Hoppel, the “Get Item from List” action applies to the return value of the action immediately before it. In your shortcut you should get the split text every time you need to access a list item: fixed shortcut.


Thanks, so far the splitting works. :+1: Now i will work on the correct date-format for Apple Health, followed by trying splitting the real fitbit-export. I will keep you updated and share the shortcut if finished.

Here’s a workflow I made to generate basic stats from a CSV file - shows how to parse rows and columns.

1 Like

Here is my final (for now) Shortcut for importing body-data (weight and body-fat) from fitbit into Apple Health. Works fine for me, have imported several years of data.

Please read the comments inside the Shortcut (only export the body-values, use at your own risk…)

And just for fun :smiley: - nice to see how the data got imported - here the steps from fitbit