cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ajl80
Helper I
Helper I

Issue Targeting Collection within Collection

Hi

 

I'm trying to create a staff course app

I have created a collection of users based on Office 365 group members

Then I have SharePoint lists :-

  • course list with course title and renewal term
  • course registration list with staff email, course completed and completion date

 

I linked the course registration collection to the users list collection using

 

ForAll(
    selectedGroup As groupRecord,
    Collect(
        UsersList,
        AddColumns(
            Office365Groups.ListGroupMembers(groupRecord.StaffGroupID).value,
            "GroupType",
            groupRecord.Title,
            "Establishment",
            groupRecord.StaffGroupEstab,
            "Training",
            Filter(
                StaffTrainingRegister,
                mail = attendee_email
            )
        )
    )
);

 

Under Search, I have a list of course checkboxes along with an expiry input box that populates a selected course collection with

Course Title & Expire

I then build another collection based on the courses selected using

 

ForAll(
    selectedTraining As tlist,
    Collect(
        FilteredList,
        Filter(
            UsersList,
            tlist.selected_course in Training.course_completed,
            If(
                !IsBlank(tlist.expires),
                If(
                    DateDiff(
                        Now(),
                        DateAdd(
                            DateTimeValue("21/05/18"),//replace with user course completion
                            Value(tlist.course_renewal),
                            Years
                        )
                    ) < Value(tlist.expires),// if datediff < entered days
                    true
                )
            )
        )
    )
);

 

Which filters users based on selected courses.
Now I want to filter out expired/close to expiry

The problem I am having is targeting the completion date within Training > user course collection.

I have manually entered a date to get it working I need to replace this with Training.completed_dateerror.jpg

Any Idea?

 

I have a feeling I need another ForAll(

0 REPLIES 0

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,024)