cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nduati
Frequent Visitor

Get Student's Grades from a Different Sharepoint List - ForAll Function

I have a Sharepoint list(Grade List) that holds the different marks and grades to be used to rank student's results as shown below Grades.PNG

I have another list (Results List) that holds the results details of the students. I am using a Gallery of repeated tables to capture these results as shown below:

Results.PNG

I need a way to automatically grade a student once i type a mark on the Mid(%) and/or End(%) columns. E.g if i type 80 on Mid(%) column, the Grade column should automatically populate as D1. 

After spending hours trying to figure out how to pick the grades from the Grade List, i decided trying to load the Grade list as a gallery(GradesGallery) on the same Screen and making it's visible property = false. I then used a ForAll function to loop through the gallery items and assign marks if a match is found. This is what i have as a Default value for my Grade TextInput, assuming we are only grading the Mid(%) whose textbox name is MidResults: 

 

ForAll(
    GradesGallery.AllItems,
    If(
        Value(MidResults.Text) <= ThisRecord.UpperRangeMarks && Value(MidResults.Text) >= ThisRecord.LowerRangeMarks,
        ThisRecord.Grade, " "
    )
)

 

 However, I get "Expected Text Value" error. At this point I am not even sure if my approach is viable or not. If it is viable, how do I get rid of that error. If it's not viable, what's the best way to get the grades?

1 ACCEPTED SOLUTION

Accepted Solutions
nduati
Frequent Visitor

I was able to come up with solution using LookUp function. I guess I was too tired, I forgot a simple LookUp would do 😊

 

LookUp(
    'Grade List',
    Value(MidResults.Text) <= UpperRangeMarks && Value(MidResults.Text) >= LowerRangeMarks,
    Grade
)

 

 

View solution in original post

1 REPLY 1
nduati
Frequent Visitor

I was able to come up with solution using LookUp function. I guess I was too tired, I forgot a simple LookUp would do 😊

 

LookUp(
    'Grade List',
    Value(MidResults.Text) <= UpperRangeMarks && Value(MidResults.Text) >= LowerRangeMarks,
    Grade
)

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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