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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Krcmajster
Helper IV
Helper IV

Importing files with wildcard

I am using file stored on sharepoint as data soruces. However, even though there will always be just one file, client wants to add date of the file, so he can keep track what he uploaded (of course there are other ways he can do it, but not the topic here)
Is there a wildcard (similar to SQL WHERE somehting LIKE '%something%') that can be added into the querry, or anything else that can ingest the file based on the  just part of the file name. 

E.g. yesterdays file was named FileName230221, today it will be FileName240221

 

let
    Source = SharePoint.Files("https://sp.sharepoint.com/sites/reops/", [ApiVersion = 15]),
    #"FileName240221 csv_https:// sharepoint com/sites/reops/Shared Documents/Files/" = Source{[Name="FileName240221.csv",#"Folder Path"="https://sp.sharepoint.com/sites/reops/Shared Documents/Files/"]}[Content],
    #"Imported CSV" = Csv.Document(#"FileName240221 csv_https://sp sharepoint com/sites/reops/Shared Documents/Files/",[Delimiter=",", Columns=115, Encoding=1252, QuoteStyle=QuoteStyle.Csv]),
1 ACCEPTED SOLUTION
PC2790
Community Champion
Community Champion

Hello @Krcmajster ,

 

You can import all the file names in binary for from the sharepoint folder and then instead of just selecting one file with a particular name, go for:

 

= Table.SelectRows(Source, each Text.StartsWith([Name], "FileName") and [Extension]=".csv" )

 

You can further perform the desired transformations

 

View solution in original post

1 REPLY 1
PC2790
Community Champion
Community Champion

Hello @Krcmajster ,

 

You can import all the file names in binary for from the sharepoint folder and then instead of just selecting one file with a particular name, go for:

 

= Table.SelectRows(Source, each Text.StartsWith([Name], "FileName") and [Extension]=".csv" )

 

You can further perform the desired transformations

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.