Validating Input

Hi All
Can someone point me to achieving the following? I have a text in a repeating group that tells a user how many items they can collect. There’s an input next to that where they type how many they are collecting right now. Outside of the RG is a button “Collect” and when they click that it records how many they’ve collected.

I want to prevent users from being able to collect more items than they have available so I’m trying to disable the Collect button. My problem seems to be that because the Collect button is outside the group that contains the Repeating Group that contains the Input to say how many items they want to collect and that also contains the Text that tells them how many items are available for collection, then I can’t refer to the elements I need with Conditions and workflows. Can anyone help me achieve this?

Many thanks

Hey @joefarrowsmith ,

here is what you can do:

  1. create one data field in user’s database
    1. “collection” with type “list of items”
    (you can change the name as you want)
  2. on button click give workflow to add the item of RG in collection database
  3. give a condition to the button “when current user’s collection:count is 10(or any limit you want)”
    and give action as this element is not clickable
    that’s it.

Here i think there is no need to add the two inputs which show the item limit and collection count to show in a RG.

Hope this will be the solution you want.

Thank you. This has given me something to think about. It’s a different method to what I had in mind so I suspect this is the route along which success lies! I’ll play with this method as mine wasn’t working. Thank you.

did it work for you?

Yes, thank you. And apologies for the delay in replying.

I managed to do it using a slightly different condition on the button than the one you suggested but your methodology helped me get there. Thank you so much.

All the best

1 Like