Forum Discussion

D3K's avatar
D3K
Icon for Advocate II rankAdvocate II
7 years ago
Solved

Bulk files upload from the folder

Hello everyone!

 

Got the question about uploading data into the system.

I have the one folder in sharepoint with sales, stocks, etc. And when I use the filter in power query to upload only neccesary files from this folder, I use the standard filter interface, where note to upload files, which name contains "stocks"". It shows me files, which contains "Stocks" and "Select all" option. File names also contains the period. But, when new file is added, power query doesn't add it to the filtered earlier list, even if it's name contains "Stocks".

 

So what I need to write in Query Editor to let it get all files with specified names, even the new ones.

 

Will appreciate any help! Thanks

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi D3K ,

    I'd like to suggest you replace accurate filter part with Text.Contains/Text.StartsWith function to check specific text string:

    #1:
    SelectRow= Table.SelectRows(Source, each [Folder Path]="https://xxxxxxxxxxxxx" and Text.Contains([Name],"Receipt"))
    
    #2:
    SelectRow= Table.SelectRows(Source, each [Folder Path]="https://xxxxxxxxxxxxx" and Text.StartsWith([Name],"Receipt"))
    

    Text.Contains

    Text.StartsWith

    Regards,

    Xiaoxin Sheng

3 Replies

    • D3K's avatar
      D3K
      Icon for Advocate II rankAdvocate II

      Hi Anonymous 

       

      Yes, sure. Please, check the situation.

      I have the folder with files: stocks, sales and receipts.

       

      When I'm adding this folder as a source, I'm using the filter in Power Query in the next way.

       

      In Query Editor it looks like:

       

      So the question is which code do I need to record into Editor (or use another tools) to make the filter work dynamically: if new file with the text "receipt" in it's name is added - automatically add this file into list of needed files (only files with receipts)?

       

      Thank you for your attention!

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi D3K ,

        I'd like to suggest you replace accurate filter part with Text.Contains/Text.StartsWith function to check specific text string:

        #1:
        SelectRow= Table.SelectRows(Source, each [Folder Path]="https://xxxxxxxxxxxxx" and Text.Contains([Name],"Receipt"))
        
        #2:
        SelectRow= Table.SelectRows(Source, each [Folder Path]="https://xxxxxxxxxxxxx" and Text.StartsWith([Name],"Receipt"))
        

        Text.Contains

        Text.StartsWith

        Regards,

        Xiaoxin Sheng