View type "FORM" with dynamic number of pages according to a parameter

Dear Community,

I’m managing a guest list for an event. The guests are added to the main list via a contact person, which I expect to fill this form I’m building, by typing: Guest Name | Guest Surname | Guest email | Contact Person (CP) email. Each time the CP saves this set, a new record is added to the guest list in a Google Sheet.
I know in advance how many guests are allowed per each CP (it’s a parameter I can store in the guest list itself, or in a separate sheet, linked to the CP’s email) , but this of course varies each time, so I can’t build a form with a default quantity of pages.

What I’d need is to prevent the form from proposing new empty records to be filled, once the “capacity” represented by the parameter is met.

How can I achieve this? I’m trying to work on the “add new row” action’s behavior, but I don’t know how to build the formula in it, or the main list to get it work as I need.

Thank you in advance for your support,

Daniele

Hi Daniele!

In the Add New Row action behavior you need to use an expression that retrieves and compares the count of guests entered is less than the event capacity. I don’t know details about your data structure, so I am just going to use a vanilla SELECT expression that will always work (after updating with your data table details). There may be ways to simplify this depending on your situation.

The expression would be similar to:

COUNT(SELECT(Guests[Guest ID], [Event] = [_THISROW].[Event])) < [Event].[Capacity]

Putting a similar expression in your action Behavior will allow the button to show UNTIL the Guest count = the capacity thent he button disappears prevent any additional ADDs from taing place.

I hope this helps!

NOTE: I am assuming that you have a REF column to an Events table that houses Event details - including the Event Capacity. Then you can retrieve the capacity value as shown.