cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Collection based on Sharepoint List and an document library

Hi

I have a list of student in a SPList.  There is a number column is "ProfilePictureID"

I have students profile pictures in a document library with the ID being the connector to the SPList column "ProfilePictureID".

 

I already have a collection of the students to give me just the ones currently on the course.

ClearCollect(ColStudentsInTown,Filter(LongTermStudents,ProgramStartDate<=Today() And ProgramEndDate>=Today()));

I wish to make a collection of the Profile pictures just for these students. 

Basically I want to being in only the images off the document library that are needed.

I have tried this without success.  I think I need a ForAll formula??
ClearCollect(ColProfileImage,Filter(ProfileImages,LookUp(ColStudentsInTown,ProfilePictureID=ID)))

16 REPLIES 16
Highlighted
Continued Contributor
Continued Contributor

@StuCundy Try refreshing the SharePoint data source in case you have deleted any column and Power Apps still referencing it. Also, as per your above formula, make sure you have ID in ProfileImages collection and ProfilePictureID in ColStudentsInTown collection.


Please click Accept as solution if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it 👍

 

Highlighted

Hi @StuCundy ,

Look in View > Collecitons > colStudentsInTown and see what fields are there. In your original post, you said you collected it with

ClearCollect(
   ColStudentsInTown,
   Filter(
      LongTermStudents,
      ProgramStartDate<=Today() And 
      ProgramEndDate>=Today()
   )
)

so I assumed ProfilePictureID was a field in LongtermStudents. Is it not in there?
My solution was then

Clear(ColProfileImage);
ForAll(
   ColStudentsInTown As MyImages,
   Collect(
      ColProfileImage,
      Lookup(
         ProfileImages,
         ProfilePictureID = MyImages.ID
      )
   )
)

which would work s long as it has the matching reference

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

Highlighted

Hi @WarrenBelz , @ganeshsanap 

I tested your formula on a test app and it worked so will go back and make some changes.

Thank you.

Highlighted

@StuCundy ,

A assume you mean the original rather than the copied one 😉

Highlighted

@WarrenBelz Thanks for your encouragement to others for using this platform (by judging & saying that they copied your formula -- when I started replying to this question there was no answer that time...maybe I am slow in replying here as I am relatively new to this platform 😊) and Thanks for the quick edits you made to your post to correct the syntax error which I pointed. I can say you are a true champion by looking at your championship 🙂 

Highlighted

@ganeshsanap ,

I will not respond further on this - it @StuCundy 's post and I am attempting to solve an issue for him.

Highlighted

@WarrenBelz That's great... we all are doing the same thing here, helping others in need. And you are like an inspiration to me Sir, to help the community and solve their issues. 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,610)