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 


Sorry, but I just read your message.

 

Here I could not move forward because it needs to present the data in some way and I decided to do it in another way, only now if they are asking me to show the data in that way.

 

The relationship between SessionMetaData and AttendanceRecord is through LessonId.

 

SessionMetaData has a Title field and that field is related to AttendanceRecord by the LessonId field

 

SessionMetaData -> Title

AttendanceRecord -> LessonId

 

Additionally, both tables have a field named ClassId that has been the identifier of the Microsoft Group team.

 

My intention is that when selecting the class to have the students as rows and the dates as columns, when making the intersection indicate their attendance.

 

I hope you have understood me, thank you very much for taking the trouble to read and again I apologize for the delay, only that I had not read your message

RandyHayes
Super User
Super User

@firektl 

One additional question - is there a record in the SessionMetaData list for each date of the class?  I.e. If Class X has a lesson dates on 12/1, 12/4 and 12/6, are there then three records in the list, one for each date?

_____________________________________________________________________________________
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 

Correct, for each attendance a record is saved in the SharePoint list, when registering an attendance a single item is created in the SessionMetaData table and N (for each student) records in AttendanceRecorde.

 

I attach some images of the SharePoint list.

 

AttendanceRecord

AttendanceRecord.png

 SessionMetaData

sessionMetaData.png

 

RandyHayes
Super User
Super User

@firektl 

So actually, that wasn't exactly what I was asking for - I wanted to know if the SessionMetaData had a record for each date.  I assumed that Attendance would certainly have a date for each entry, but I was looking to see where to find the date "truth".  

I believe, based on the image, that there is a single record for the class and then the dates that the class occur are not stored in that record (or as multiple records in the list), but instead are in the Attendance.  

So, I would wonder why you would have a lesson date in the SessionMetaData...since the image only shows correlation between the two lists in regard to only ONE lesson date, perhaps my assumption is incorrect and there is in fact a record in SessionMetaData for each lesson date....please clarify.

_____________________________________________________________________________________
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!

Good Morning @RandyHayes 

 

I hope you are well.

 

I wanted to know if the SessionMetaData had a record for each date. 


Answer: Yes, for each date a single record is created in SessionMetaData.

 

The application I am using is called Attendance App and it is available on the web, I just adapted it to my organization,  there is a selection called "Data stores" where they detail how the information is stored.

 

Thanks again for your time and sorry if I am not complicating you a bit.

 

 

 

RandyHayes
Super User
Super User

@firektl 

Nope...all makes sense and I am glad you have a record for each date in the session metadata list - this will make it much simpler.

I will get you a solution for this tomorrow (if you don't hear back from me - nag me) - sorry for the delay.

_____________________________________________________________________________________
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 ,

 

Sorry for the trouble, but you told me: "nag me" if I didn't have an answer from you, and here.

 

I am! You are my hope! 👼

RandyHayes
Super User
Super User

@firektl 

Yikes!  Sorry that I dropped it.  That's why I said...nag me 😅

 

Here is what I came up with.  I put a Dropdown on my screen and set the Items property to the following:

AddColumns(
        GroupBy(
            SessionMetaData,
            "Title",
            "_records"
        ),
        "Attendance", GroupBy(Filter(AttendanceRecord, LessonID =Title), "Student", "_studentRecords")
    )

This is based on the tables that you gave pictures of (except I was lazy and used Student instead of StudentName).

 

Now, I have a Gallery on the screen and its Items property is set to the following:

ForAll(Sequence(CountRows(Dropdown1.Selected.Attendance)+1,0), 
    With({thisItem:Coalesce(Last(FirstN(Dropdown1.Selected.Attendance, Value)), Blank())},
        {student: If(Value=0, "STUDENT", thisItem.Student),
        _attendance: 
            If(Value=0, 
                ForAll(Dropdown1.Selected._records, 
                    {stat:Text(LessonDate, "[$-en-US]d-mmm")}
                ), 
                ForAll(Dropdown1.Selected._records As Recs, 
                    {stat: If(IsBlank(
                           LookUp(thisItem._studentRecords, 
                             LessonDate=Recs.LessonDate, LessonDate)
                          ), "A", "P")
                    }
                )
            )
        }
    )
)

This gives us a nice table of records with a student column and a _attendance column.  The student column is the student name, and the _attendance column is the table of attendance records for that class and that student.

 

To reduce the extraneous amount of controls to create a Header for the Gallery, I inject a first row (Value 0 in the above) that has "STUDENT" for student and the gathered list of class dates (done in the dropdown).  So, if Value=0 (the injected row), then _attendance column (which will be a table returned from the ForAll's) gets the Text version of the LessonDate in the d-mmm format in the stat column of the records.  Otherwise it will be a table of records based on a Lookup into the Attendance table (again done in the DropDown record) based on the date of the class LessonDate and the Student (which is actually already filtered out from the DropDown).  In other words the Attendance table column on the DropDown will only have the list of dates that the student attended (and it is grouped by the student) and this formula will match those into a table for that student, this class and their attendance based on lookup.

 

The First Gallery has a label in it with the Text property set to : ThisItem.student

 

So now that we have this nice grouped, filtered, and prepared table, we can feed it to the next level, which is a Nested Gallery in the first Gallery.  It is a Horizontal Gallery, so that we can have columns.

The Items property for that is set to ThisItem._attendance

There is a Label in the second gallery with a Text property set to : ThisItem.stat

 

Putting it all in play...it looks like this:

firetkl.gif

I've attached a sample app for you. Download it to your computer.  Then go into PowerApps designer and either open an existing App or Create a New one (not making a difference which because you are going to open this one).  Go to File->Open->Browse and then browse for the downloaded file to open it.

 

I've made a mocked up list of data.  You can find all of that in the Dropdown Items property.

 

Examine this all and let me know if you have any questions.

 

 

_____________________________________________________________________________________
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!

Hello @RandyHayes 

 

Ohhh it looks super, I'm going to adapt it to my code and I'll tell you how I'm doing, thank you very much for your time. He wrote to you directly, if you can answer me.

 

Total thanks.

Hi @RandyHayes 

 

I am trying to implement the code you made.

Initially, I am creating a Dropdown and placing the code

 

AddColumns(
    GroupBy(
        SessionMetaData;
        "Title";
        "_records"
    );
    "Attendance";
    GroupBy(
        Filter(
            AttendanceRecord;
            LessonId = Title
        );
        "StudentEmailId";
        "_studentRecords"
    )
)

 

But I get an error. error 3.png

 

I understand that at this point you want to generate the dates by class.

 

In the code you sent me, you create tables from the SessionMetaData and AttendanceRecord lists, should I also create these tables?

 

Thank you, I am attentive to your comments.

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!      

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Top Solution Authors
Top Kudoed Authors
Users online (2,648)