0

Button with script to populate table

Hi. I have a database as per the model in the picture. 

1. Table with students.

2. Table with classes. Each class has a table of students (3) picked up from 1.

3. Table with assignments. For each assignment there is a table with the classes that were given that assignment (5).

I wanted a button that would automatically populate 6 with all the students that belong to the classes in table 5.

9 replies

null
    • Fred
    • 3 mths ago
    • Reported - view

    1) just to be clear, you have reference fields in table 6 that links to table 4 and 5 separately? or is Table 6 a child of table 5?

    2) Where will this button sit? Table 4 or Table 5?

    • John_Halls
    • 3 mths ago
    • Reported - view

    6. List of Students... is not a table but a view that uses the existing structure. So create a view in the 4. Assignments table with this formula

    '5. Classes with Assignments'.'2. Classes'.'3. Students per Class'
    

    And then in Edit columns put the Name of the student. If you need a unique list then group them together.

    • Alain_Fontaine
    • 3 mths ago
    • Reported - view

    Or:

    unique('5. Classes with Assignment'.'2. Classes'.'3. Students per Class'.'1. Students')
    
      • John_Halls
      • 3 mths ago
      • Reported - view

      I tried this and couldn’t get the view to work. Not sure what I was doing wrong. 

      • Alain_Fontaine
      • 3 mths ago
      • Reported - view

       Did you adapt the definition of the column to be displayed ?

      • John_Halls
      • 3 mths ago
      • Reported - view

       I was trying it prior to setting any columns. It doesn’t show any records. Had me flummoxed. 

      • Alain_Fontaine
      • 3 mths ago
      • Reported - view

       🤷‍♂️I took the database you uploaded, changed the formula defining the view, and then the formula in the column. Nothing more, nothing less. Version 3.12 for iPad.

    • John_Halls
    • 3 mths ago
    • Reported - view

    Hi    working as it should, thank you. I think it might have been a column formula that threw it, as you said. Maybe I was trying too hard to beat  to an answer and rushed it!

      • Fred
      • 3 mths ago
      • Reported - view

      love these posts where the original poster hasn't responded but others continue it.

Content aside

  • 3 mths agoLast active
  • 9Replies
  • 63Views
  • 4 Following