Forum Discussion

CaioSilva's avatar
CaioSilva
Copper Contributor
Jan 12, 2021
Solved

[SOLVED] Power Query - Try don't work with Folder.Files

Oi pessoal!

 

Esta é minha primeira discussão, então eu tenho um problema ao tentar carregar pastas diferentes (no OneDrive) no Power query Excel. Usei a instrução try para corrigir isso, tentando abrir duas pastas diferentes, mas não funcionou. Ela não retorna um registro com os campos [HasError] e [Erro / Valor] para mim.

 

Desde já, obrigado.

  • Guys, i solved this using a following statement:

    Source = try Table.Buffer(Folder.Files(AnyPathHere)) otherwise Folder.Files(OtherAnyPathHere)).

    Using Table.Buffer the try statement works again.

3 Replies

  • CaioSilva's avatar
    CaioSilva
    Copper Contributor
    Guys, i solved this using a following statement:

    Source = try Table.Buffer(Folder.Files(AnyPathHere)) otherwise Folder.Files(OtherAnyPathHere)).

    Using Table.Buffer the try statement works again.
    • Mold's avatar
      Mold
      Occasional Reader

      Thank God, you did this, man.
      It saved my day.

    • JudasLupo's avatar
      JudasLupo
      Copper Contributor
      Can confirm, I had queries that would get corrupted just because Windows display language was different between users. It just saved me a ton of work and now anyone can refresh said queries.