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 / ForAll function to imp...
Power Apps
Answered

ForAll function to import data from excel to a collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to take the data from the excel DataSource and place it in a Collection.

 

I have a Excel Datasource:  Table1_2   

One field  "Supplier_Name"

I have a Collection called  "COLLECT_BrandList"

One field  "Supplier_Name"

 

I'm using the function  ForAll()  Does this seem correct ?

Function:

ForAll(Table1_2, Patch(COLLECT_BrandList, Defaults(COLLECT_BrandList),{Supplier_Name: Supplier_Name}))

 

Thanks

Dave

 

 

Categories:
I have the same question (0)
  • GarethPrisk Profile Picture
    2,828 on at
    Collect(COLLECT_BrandList,Table1_2)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @GarethPrisk 

    just asking, was there anything wrong with the ForAll function ?

     

    I plan on having around 5,000 records in the excel table ?

    any issues...I placed  502 records in the Excel table just to see if I would have any delegation issues.

     

    Dave

  • Verified answer
    GarethPrisk Profile Picture
    2,828 on at

    The ForAll function is effectively a loop. It will take a table, and loop through each of the rows, and then allow you perform an action against that row.

    The Collect function is effectively creating a row in a table.

    However, the Collect function does support creating a collection (table) from a source (almost always tabular). I don't know if it's short-handing what the ForAll is doing, but it's only one function to invoke. If you do the ForAll approach, you would be invoking the Collect, or Patch, or whatever function(s) over-and-over again.

     

    In your example

    ForAll(Table1_2, Patch(COLLECT_BrandList, Defaults(COLLECT_BrandList),{Supplier_Name: Supplier_Name}))
    • The ForAll usage is valid, it will apply a function(s) against each row of the Excel table
    • The Patch function is mostly valid
      • The Collection would have been invoked in another step
      • Collections typically don't have Defaults, they're just tables with columns based on the data that is being put into them (meaning you don't define a data type, it just knows)
      • You are mapping a source column to an identical column in the collection - I would avoid this
    • Again, this would invoke the Patch function X times, per X rows in Table1_2
      • As noted in previous post, this can be simplified to invoking a single function Collect(collectionName, tableName)

     

    I think you can have as many columns as you want in the Excel table. Excel as a static data source, to my knowledge, is not subject to any delegation issues. In fact, I just tested an Excel table with 10,000 rows and it was collected instantly, without issue.

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard