Unselected values in enumlist

I have a enumlist that is a list of students. I can pick any number of students and the field [present] is set to true. I would like to be able to have all the rest of the list set to false for that day. Right now I have the [present] field default value set to false. when I add the attendance the selected studentโ€™s present value is set to true using a behavior action that creates an individual record for each selected student in the enumlist using the following formula index([STUDENT_ID], [COUNT]). My question is, is there a way to index the students that are not selected?
Or
is there a way to set the unselected studentsโ€™ [present] field to false?

Thanks,
Flan

Solved Solved
0 12 260
1 ACCEPTED SOLUTION

This is the way to go in my opinion

The other way is maybe by a list substraction

STUDENTSTABLE[KEYCOLUMN]-YOURENUMLIST

You will get a list of the students that are not selected.

BTW, why you need to have a YN column on the students table if that changes technically everyday?

View solution in original post

12 REPLIES 12

and or if the field is set to true?

Can you elaborate? Where is [Present] located? Which basetype is the EnumList?

So Students is another table and the EnumList is basetype Ref?

Can you tell us how you did that? Is related to Looping with actions?

I have no way to tell you anything about this before we get more info.

Please give us a better intro to your app, what it does, the tables that you have and their schema

to answer your questions:

  • enumlist for students is in a table called attendance_table its of type ref.
  • [present] is set to false by default and it is in the attendance_table.[present] is of type yes/no.
  • student_table is whatโ€™s referenced in attendance_table[student_id]

My app keeps track of attendance.
what happens is that when you add an attendance you choose the acadamy, the date, and the student(s)
the attendance_table is where the records for the students are kept. the acadamy field is a ref of the acadamy_table, date is set to today() or you can choose a date. and the student(s) is of type enumlist with a base type of ref.
each record is stored in the attendance_table using a looping behavior action.

what I am trying to figure out is how to create records for each of the students that were absent and set the present field to โ€œfalseโ€.

Iโ€™ve been thinking about just creating a separate table for absent students and using a behavior action to fill the table. however, I am not certain that is the most efficient way to do it. I figure if I can reference the non-selected students there might be a better way.
Thank you for your help.
Flan

This is the way to go in my opinion

The other way is maybe by a list substraction

STUDENTSTABLE[KEYCOLUMN]-YOURENUMLIST

You will get a list of the students that are not selected.

BTW, why you need to have a YN column on the students table if that changes technically everyday?

well because if they miss a certain number of classes we want to know.

This part is the key.
Ths students table should have info about the students that is not changing all the time, like their birthday, gender, name, etc.
If they were on a class or not should not be on the students table

Yes. Agreed. If the student attended class that is part of the attendance_table. What I donโ€™t have is a record that says if a student did not attend class.
This is what I am trying to figure out how to do.

Thank you for your help.

the Y/N isnโ€™t in the student_tableโ€ฆ Its in the attendance_table

created a new table with an action to copy using your formulaโ€ฆ thanks for the guide

In the Add Attendance form, I have a drop down that is of type ref it references the academy_table. At the moment I have two academies โ€˜aโ€™ and โ€˜bโ€™. In the same form I have an enumlist that I was able to filter down to a list of students by the academy selected in the aforementioned academy drop down.that they are currently assigned to. In the attendance_table[student_id] validif section I used FILTER(โ€œSTUDENT_TABLEโ€, ([ACADAMY] = [_THISROW].[ACADAMY_ID]))
this currently works to list out the students only in that academy. However, what I have come to find out is that in filling the absent table I use list subtraction with the following filter((student_table[_thisrow]-[STUDENT_ID]).
This does filter out the students that were selected but also includes the students from the academy that were not in the original enumlist. Iโ€™ve tried all sorts of different filter() and select() statements and havenโ€™t been able to find one that works. Perhaps something like filter(โ€œstudent_tableโ€,([student_id] = [_thisrow]-[student_id])and ([acadamy] = [_thisrow].[acadamy_id])) ???

This expression doesnโ€™t make sense, it has an extra parentheses also

(student_table[_thisrow]-[STUDENT_ID]) <โ€” this works. In that it gives me a list of students per the academy selected.
sorry for the extra paren and the filter() not sure how that got there.
โ€ฆ type-o. STUDENT_ID is the enum list.

I guess what I need is (student_table[_thisrow] - [STUDENT_ID] filtered by [ACADEMY] just donโ€™t know how to do it.

Top Labels in this Space