Parsing text from dictate in Shortcuts

I am trying to record blood pressure in Health. There is an API to add a blood pressure reading to Health. It takes the systolic and diastolic readings as two integers. When you dictate “124 over 76” it comes out as 124/76 which seems handy for parsing but I cannot figure out which steps to use. When I split text using a custom separator of / the first item is 124 but there is no second item. In particular, doing Get item from List using Item At Index 2 always gives an error. It I add a count and a quick look right after the split, it shows 2. For debugging I just have a text step instead of dictation.

I don’t see what else to try at this point. Can someone give me some pointers?

1 Like

Are you absolutely sure you are doing that? Only, when I start with that txt, split it by a forward slash and reference the split list items, I get exactly what you would expect.

Perhaps you could share your shortcut and we could take a look at the details?

1 Like


I don’t have a Repeat with Each. I was thinking I could use Get Item From List and Set Variable to get access to what I need.

Here a link to my Test shortcut.
https://www.icloud.com/shortcuts/3d2ad471a14646d8bda392e96ba97889

You have split your list, taken the first item and then tried to take the second item of your first item rather than the second item of the split list.

Try adding in a Get Variable to retrieve the split list and then get the second item of that.

3 Likes

Thanks. This works great. I was thinking get item from list would work on the most recent list instead of the most recent output regardless of type.

Next up will be validating the items are numbers incase the dictation is a little off. But that can be for another day.

1 Like