Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
poinfrettia
Frequent Visitor

Allowing schema drift in Gen 2 Flow combining all files in a folder

Hi there,

 

I have a Gen 2 Flow which combines all files in a folder. All files contain the same key columns, but not always in the same order - and some files have extra columns thrown in.

 

The flow is throwing an error when a file with an extra column is included. How can I set it up to allow for this variation in the input files? 


Cheers,

Ali

1 ACCEPTED SOLUTION
poinfrettia
Frequent Visitor

I have another flow where the columns differ, and it doesn't throw an error - the Gen 2 Flow manages them automatically. The issue must be something else. 

View solution in original post

4 REPLIES 4
poinfrettia
Frequent Visitor

I have another flow where the columns differ, and it doesn't throw an error - the Gen 2 Flow manages them automatically. The issue must be something else. 

miguel
Community Admin
Community Admin

would you mind sharing the query script (the full code) of your "Transform sample query"?

Thanks miguel, 

 

Sure - this is the 'Transform Sample Query' step: 

let
  Source = Csv.Document(Parameter, [Delimiter=",", Columns=22, Encoding=65001, QuoteStyle=QuoteStyle.None]),
  #"Removed top rows" = Table.Skip(Source, 1),
  #"Promoted headers" = Table.PromoteHeaders(#"Removed top rows", [PromoteAllScalars = true])
in
  #"Promoted headers"

I know you marked the issue as solved but just throwing my $0.02 out there.

 

  • You could expand your columns out "Columns=23" to the widest range of your files.
  • I wonder if the error you're getting is from a data type mismatch? Like if file one has a text format and file two has a number in the same column? 
  • Are the files random on how you collect if they have the extra columns or not? If they're structured that X files have one format and Y files have another format. You could always do two (or more) separate power queries and clean them up so the columns line up and then append them.

Helpful resources

Announcements
September Fabric Update Carousel

Fabric Monthly Update - September 2025

Check out the September 2025 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.