web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Collections

(0) ShareShare
ReportReport
Posted on by 124

Is it possible to take SQL server table data or SharePoint list data and make it into a collection in PowerApps rather than adding individual data records to a collection?

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,582 Moderator on at

    Hi @azizrasul 

     

    Yes it's possible but Collections have Limitations You can easy do Temporary collection like this 

     

    ClearCollect(colMyData, DtataSource)

     

    or You can use Collect function what will store Data inside of the App but only for that user

     

    Keep in mind Collection will only store 2000 records there are ways to extend this more info about this here:

     

    Delegation – Practical Power Apps

     

    Collections can collect data from SQL and SP List 

  • Ygor Profile Picture
    44 on at

    Hi!
    I don't know about SQL server table, but SharePoint list you can use this:
    ClearCollect(CollectionName, SharePointList)
    I use this in property "OnVisible" of screen, this way, when navigating to that screen, the collection will always be reset, ensuring that all new data is loaded.

  • azizrasul Profile Picture
    124 on at

    After having cleared the collection, how do you load the SQL Server\SharePoint data into the empty collection?

  • SebS Profile Picture
    4,582 Moderator on at

    @azizrasul 

     

    If You used Clear(Collection) You can just again do Collect() or ClearCollect() to upload new data to that collection.

     

    you can also use UpdateIF(), Patch() and RemoveIF() with Collections it's all depend what You need to achive.

     

     

     

  • Ygor Profile Picture
    44 on at

    You can use ClearCollect function. The ClearCollect function deletes all the records from a collection. And then adds a different set of records to the same collection.

    This link can help you understand how to use collections:
    Collect, Clear, and ClearCollect functions in Power Apps 

  • azizrasul Profile Picture
    124 on at

    So clearing the data is fine, I understand that now.

     

    What I'm still stuck in my understanding is if, let's say I have a SharePoint list called "SP1" which contains say 2 columns "First Name" and "Last Name". I have a PowerApps project open with a blank canvas containing a single button. 

     

    If on the OnSelect property of the button I insert 

     

    Collect(NewCollection,SP1)

     

    and then go to Collections, I can see the NewCollection as this is the only collection I have, I see there are no records and the field names are not what I have in my SharePoint list and there a lot of field names.

     

  • SebS Profile Picture
    4,582 Moderator on at

    @azizrasul 

     

    So SharePoint creating a lot of support columns and what you see right now is all that data is pulled from SP List. You can ignore it.

     

    Main Columns will be First Name and Last name and you can refer to them depend of situation

     

    Example if You pass this Collection to Gallery items property You will be able to create a label and refer to columns by using "ThisItem" and in your case it will look like ThisItem.'First Name' keep in mind if You used Title column and You did rename it to First Name for example You always will refer to it as Title means You will use ThisItem.Title to display First Name in a label. 

     

    You can use collection outside of gallery as well but this will be harder as collection have multiple records and You will need to point to right record to display Text for example in a label out side of the Gallery.

     

     

  • azizrasul Profile Picture
    124 on at

    I have selected NewCollection as the data source of the gallery.

     

    What do I write in the OnSelect property of the button to get the SharePoint data into the NewCollection collection.

     

    I have tried 

     

    Collect(NewCollection,SP1,{FirstName:'First Name', Last Name:'Last Name'})

     

    but all I get is errors.

  • Verified answer
    SebS Profile Picture
    4,582 Moderator on at

    @azizrasul 

     

    Please visit below link this will explain you with examples how to use collections:

    Power Apps Collections Examples (matthewdevaney.com)

     

     

  • azizrasul Profile Picture
    124 on at

    Thanks will have a look.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard