Simple dictionary use - repeat for each woes

*novice shortcutter skills here *

I’ve searched and copied and tried to edit some shortcuts I found online but I am having trouble using a dictionary in my shortcuts.

The shortcut is pretty simple:

  1. I put in the weight of a patient
  2. I have a dictionary (key is the name of the treatment medication, value is a number representing dosage)
  3. The calculation step is supposed to go through each of medications and give me the dose for the animal based on its weight.

The first dictionary entry initially worked ok and I can get a text output sentence with the variables in it.

As soon as I add repeat I can’t get it to work. Even the first calculation stopped working. I’ve deleted everything after the dictionary and just commented the desired steps.

https://www.icloud.com/shortcuts/9a78a3872aee456eb462b18fea1b5ebc

You’ll have to get the dictionary keys and repeat from those.

https://www.icloud.com/shortcuts/aff63a58748f46bfa8d5500578918848

Thanks so much!

The quick help with solutions in this group is amazing.

Much appreciated :raised_hands:

Hmm.
This is working great as is, but got me thinking. I know my patient weight and total dose required with the multiplication of
PatientWeight x mg per kg = calculated dosage.

With medications the next step is taking the jar with ie 3000 mg/scoop and having the shortcut also output the amount of powder/scoops/tablets

ie

Patient: Test Horse
Weight: 485kg

The dose for TMS is 7275mg.
Administer 2.425 scoops/tablets.

The dose for Gaba is 5820mg.
Administer 2.328 scoops/tablets.

I tried to duplicate the dictionary with the same key name and then the number being the concentration/scoop, but can’t get the calculation to work.

I think it would maybe be easier if the drug dictionary entries were not numbers but actually dictionaries for each drug (containing dosage, concentration, measurement, and frequency)
… I can’t figure out how to cycle through each drug name and then do calculations based on the items in the key dictionary …

Revised link with comments inserted re dictionaries

https://www.icloud.com/shortcuts/e73a81c90c1c49bf841f64f515e0356a