Another bill splitting shortcut

Hey everyone, I’m looking for some help.

Firstly I am new to programming and also new to using shortcuts.

I am looking to create a shortcut which calculates each persons contribution to a bill (in the event that it is not split equally) - I know that there are a lot of tip calculating/bill splitting shortcuts already - but I am yet to see one where the bill can be split unequally - I also know that there are specific apps for this, but I want to learn to do this myself (if possible).

Anyway, the tip calculation and equal split parts of the shortcut are working fine (in a separate shortcut for now). For simplicity this shortcut only asks for the input of total cost and the number of people. I am not sure how to get individual contributions working.

I would like to try to create a repeating script (based on the number of people), which then cycles through each persons contribution, so person 1, 2, 3 and so on. It would also be great if when this runs, I could put more than one item for each person. So after person 1 gives their first contribution, a menu pops up, should person 1 pay for more items? Yes/no

My first issue was trying to create a list (or other method) to generate the number of people based on the input (person 1, 2 etc). Even if it is not possible to generate a list which names the people specifically per say, I still couldn’t get repeat with each item, to cycle through the number of people.

My second issue, was when using the menu, to allow for multiple contributions, I wasn’t sure how to cycle back through it, when Yes is selected. The no part was ok, as it would just present the remaining sum and jump to the next person (although it doesn’t jump to the next person as I am doing something wrong with my repeat).

Also, I’m not looking to add anything beyond this, so I don’t think I will check any individual contributions exceed the total amount.

So I’m not even sure if something like this is possible using shortcuts and I would be grateful for help.

Thanks in advance!!

1 Like