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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Best practices for Gal...
Power Apps
Answered

Best practices for Gallery: when to go Sources direct vs. intermediate Collection?

(0) ShareShare
ReportReport
Posted on by 192

In my case, I am looking at a Gallery which will hold multiple GoogleCalendars, each with multiple events and their associated metadata.  Should I first filter the data into a collection and use the collection in the Gallery, or can I directly put the filter function in the gallery and count on Gallery to load records as needed (as we scroll through groups of records).  Filtering the data into a collection would require a "batch filter" (e.g.: from date1 to date2 for CalendarEvents) to be explicitly programmed, while it might not be necessary for Datasource if PowerApps Gallery is smart enough to "filter and cache ahead" as we scroll through records.  Any advice is welcomed,

Thanks,

Olivier

Categories:
  • Verified answer
    v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi Olivier,

     

    I’m not totally clear what you are trying to do. But, I would think I would not create a collection but would prefer to filter the data directly.

     

    I have multiple calendars in Google Calendar. Then created an app in PowerApps and connected to Google Calendar. Added a Gallery using this formula:
    GoogleCalendar.ListCalendars().items

     

    The gallery displayed Description, id and summary. The summary shows the name of the calendar. Then I added a second gallery with this formula:
    GoogleCalendar.ListEvents(Gallery1.Selected.id).items

     

    In this gallery I show the summary, start and creator.

     

    When I added a new item to the calendar the app updated when I selected the calendar in gallery1.

     

    I hope that this makes sense and is close to what you are trying to do.

     

    Best regards,
    Mabel Mao

  • Meneghino Profile Picture
    6,949 on at

    Hi Olivier, I agree with Mabel that it is best to go direct to the source, particualrly if your data source has <500 records or supports delegation for the filters you use.

    I mostly use SQL server (which supports delegation) so PowerApps is smart enough to fetch the needed data as we scroll through the records. It seems to fetch the data 100 items at a time up to a maximum of 500 items displayed in the gallery.

    I have played with pre-loading source data into collections, but it is fiddly, requires timers to refresh etc. etc.

    Hope this helps.

  • Olivier Profile Picture
    192 on at
    Thank you Mabel,
    Yes, this is the info I needed.
    Olivier
  • Olivier Profile Picture
    192 on at
    Thank you Meneghino, I have also found that "caching" the data using Collections can be quite cumbersome and it is better to use it only when really necessary.
    You mention that you use SQL, did you install a Gateway? Did you write a custom API to your database to have a connector?
    Thanks,
    Olivier
  • Verified answer
    Meneghino Profile Picture
    6,949 on at

    Hi Olivier.  I work in two companies and we use SharePoint Online in one and SharePoint on-premise in the other.  For a couple of years now I have been using Access Web Apps (AWA), which is a little known capability of SharePoint but great, although it is now no longer being developed.  Basically it is an SQL database with lots of functionality but with no hassles.

    For the SharePoint online no need for a gateway, just connect straight to the AWA with its database credentials.

    For the SharePoint on-premise we installed a gateway, which was quite simple.  The connected to the AWA with its database credentials.

     

    Please let me know if you use SharePoint and not yet AWA so I can give you more details.

     

    In the longer term I plan to migrate form AWA to CDS as soon as two things happen:

    1. CDS gets query capability (to overcome the 500 item limit)
    2. CDS becomes readable by Excel Power Query and/or Power BI (to produce analysis and reporting)

    Hope this is useful

  • Olivier Profile Picture
    192 on at
    This is very useful indeed, we have our own data source for some of the data we use in PowerApps. For that we developped our own API. I have been investigating CDS as well, and your points are well taken. Are the features you mentioned on the roadmap?
    Thanks again Meneghino.
    Olivier
  • Meneghino Profile Picture
    6,949 on at

    I think they are, but timing is not clear.  Frankly I cannot see anyone seriously using CDS without these capabilities so I hope we'll get them soon.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard