I'm newish to repeats, and I'm working on a survey connect for "food rescue", and want to limit the number of repeats available in different scenarios.
Project Structure: There will be two surveys in the workflow pointing to the same feature layer with relate table (one survey for donors, one for rescuers)
1. Donors (restaurants/grocers) submit a food donation... each row is a new donation (repeat is hidden in their survey). They input an approximate weight. They also decide if they want to allow multiple claims for one donations... split it up per say.
2. Rescuers (pantries/shelf) open experience builder app > see Available donations > click "claim" button on a donation in list, which opens a different version of survey... now showing the repeats. If allowed by donors, Rescuers can claim part of the donation, by designating what percentage they will claim. (select_one likert ...10% - 90%)
This then calculates outside the repeat (donation weight - (sum of percent's from repeat x donation weight))... to show how much is remaining...
That is used to then determine if the donation is Available, Claimed, or Part Claimed... outside of the repeat.
What I'd like help with is setting up the repeats for the rescuers to:
1. Restrict to one repeat record if the donor didn't allow splitting. ${order_split} = 'No' repeat_count = 1
2. Turn off adding more repeat records once the remaining donation is zero or "claimed". ${Remaining} <= 0 and ${order_split} = 'Yes'
Do I just write a complex if statement in the repeat_count field? Or do I add this to the relevant field to "hide" the repeat when at zero? I imagine I've limited the donation to 9 repeats with the percents select one... so setting repeat_count to 9 is better than nothing... but not quite there.
Thanks!! 🙂
