Limit the number of child entries

This is what I have going on right now:

[Allowance] Column in Parent Table with the number of entries I want to allow
[Request] Virtual Column in Parent Table with COUNT([Related Request])
[Remaining Request] Virtual Column in Parent Table with ([Allowance] - [Request])

Action in Parent Table to open form and add request in Child Table with condition [Remaining Request] > 0

The Action works, I just can’t figure out how to apply it to the Child Table system Add action.

I dont understand this part.
You dont need to set any action in child table, for this caes.

(
  COUNT(
    FILTER(
      "Child Table",
      ([Email] = USEREMAIL())
    )
  )
  < LOOKUP(
    USEREMAIL(),
    "Users",
    "Email",
    "Child Limit"
  )
)

Substitute your table and column names as appropriate.

2 Likes

I don’t think that will work. This is what I have and am trying to do:

  • App Users Table

    • Has Security Filter: [Email]=USEREMAIL()
    • Each user has a column [Parent Name]
    • Multiple Users can have the same [Parent Name]
  • Parent Table

    • [Parent Name] is the column that is referenced by User Table and 10 Child Tables
    • Parent Table and all Child Tables have a Security Filter: IN( [Parent] , App Users[Parent Name] )
    • Parent Table has a number column [Child Table1 Max Records]
    • Each [Parent Name] will have a different number in [Child Table1 Max Records]
    • Parent Table has a virtual column [Child Table1 Records]
      • Formula: COUNT([Related Child Table1 Records])
    • Parent Table has a virtual column [Child Table1 Records Remaining]
      • Formula: ([Child Table1 Max Records - [Child Table1 Records])
    • Parent Table Detail View has a prominently displayed Action Button I created for opening a form view and adding a new record to Child Table1
      • Condition: [Child Table1 Records Remaining] > 0

The Action I created works and does not display when the condition is met. I can’t figure out how to make the same thing happen in Child Table1 or the Related Child Table1 views. I want to disable Add everywhere when the [Child Table1 Records Remaining] hits zero.

I hope this makes sense and someone can help me out. I don’t fully understand formulas yet and my brain is fried from trying to figure this out.