Is there a way to limit the amount of rows that can be added by a user?

I have a menu where you can enter your team, but I only want to allow the user to enter up to 3 team members and after 3 are added then the Add button disappears unless they delete one of the team then the Add button can show up again. I'm using this because within the app I have a selection of who to send emails and notifications to. 

0 5 139
5 REPLIES 5

Yes.

The right implementation depends on lots of details of your current app design and exactly what you're seeking to accomplish. My best guess is that you want to control the availability of the Add action for a Members child table that references a Teams parent table. Specify your condition using an expression in the action's Only if this condition is true property--for instance:

COUNT([Team ID].[Related Members]) < 3

@dbaum Thank you or the reply. 

I tried adding that to the action's Only if this condition is true property but wasnt abel to get it to work. 

Here is what the columns look for that sheet 

SalmonTC_0-1686701246792.png

I added the Team ID for it because I didn't have it  and regenerated the structure. 

When I try using the Count function it give me this error "COUNT function is used incorrectly"

Here is the formula I'm trying to use COUNT([Team ID].[Name]) < 3


@dbaum wrote:

a Members child table that references a Teams parent table


It looks like this isn't the case. Consider whether such a data structure might benefit your app.

Given your existing app design, an expression along the lines of the following might work:

COUNT(SELECT(Members[Team], [Team] = [_THISROW].[Team])) < 3 

I tried using it like this:

COUNT(SELECT(Real Estate Agent[Team ID], [Team ID] = [_THISROW].[Team ID])) < 6

Since I have 6 members on there but in the future I want to limit it to 3, but it doesn't seem to be working 

it seems that using this works:

COUNT(Real Estate Agent[Team ID]) < 6
Top Labels in this Space