cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
firektl
Helper III
Helper III

Gallery with date columns

Hello Community,

I hope everyone is well.

I am developing a dashboard which I want to show me the assists according to selected parameters.

I am connecting my dashboard to two sharepoint lists, these lists have the following structure:

 

In the SessionMetaData list I have:

Title: unique field
ClassId: class identifier (team ID in Microsoft Teams)
LessonDate: class date
StartTime / EndTime: start time and end time of the class
ClassName: Class name (team in Microsoft Teams)
TeacherEmailAlias: email of the teacher who takes the attendance.

 

sessionMetaData.png

 

In the AttendanceRecord list:

Title: unique field
LessonId: Code of the sessionMetaData list (with whom I relate both lists)
LessonDate: date of attendance.
Attendance: I save the student's attendance (present, absent, late, excused)
StudentEmail: student's email.
Notes: a comment.
AttendanceTakenBy: name of the teacher taking attendance.
ClassId: class identifier (team ID in Microsoft Teams).
StartTime / EndTime: start time and end time of the class.
StudentName: name of the student.
ClassName: Name of the class (team in Microsoft Teams).

 

attendanceRecord.png

 

I require to display the information like this:

 

ATTENDANCE.png

 

The problem is in how to generate the columns of the dates, since they are going to vary depending on the class.


Please have any idea how to display the information.

 

Thank you very much

43 REPLIES 43
RandyHayes
Super User
Super User

@firektl 

Yes, so, since the items are grouped by the ClassId, the resultant _records of the group will have all of the records that match that ClassId.  If ClassId and ClassName are connected (i.e. the classid and the classname are always the same) then you can just get the First record of that group and the classname from it.

Example:

AddColumns(
    GroupBy(
        Filter(SessionMetaData; TeacherEmailAlias = Office365Users.MyProfile().Mail && (LessonDate >= fromDate.SelectedDate && LessonDate <= toDate.SelectedDate));
        "ClassId";
        "_records"
    ) As _sessions;
    "_className"; First(_records).ClassName;
    "_classAttendance";
    GroupBy(
       SortByColumns(
        Filter(
            AttendanceRecord;
            ClassId = _sessions.ClassId
        ); "StudentName")
        
        ;
        "StudentEmailId";
        "_studentRecords" 
    )
)

This will add a _className column to it that you can use for the Dropdown display.

 

Yes...busy and now trying to catch up on about 5 days of messages and responses I've missed!! 🙄

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes 

 

I made some adjustments in your line of code, putting directly First (_records).CllassName gave me an error.

 

I will mark your answer as correct.

 

Thanks for all your help and interest.

 

You are a sun.

 

AddColumns(
    GroupBy(
        Filter(SessionMetaData; TeacherEmailAlias = userMail && (LessonDate >= fromDate.SelectedDate && LessonDate <= toDate.SelectedDate));
        "ClassId";
        "_records"
    ) As _sessions;
    "_className"; First(_sessions._records).ClassName;
    "_classAttendance";

    GroupBy(
       SortByColumns(
        Filter(
            AttendanceRecord;
            ClassId = _sessions.ClassId
        ); "StudentName")
        ;
        "StudentEmailId";
        "_studentRecords" 
    )

)

 

RandyHayes
Super User
Super User

@firektl 

Oops. forgot that I had used an As in the formula...yes, you have it correct!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes 

 

Don't worry, you gave me the light on the way.

At the beginning it did not generate the column of "_className" but it was an error that I had with the Filter by user, so I used a variable to correct the problem.

Thank you very much again.

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (3,765)