I am using Power Query in Excel for Microsoft 365.
I have a Power Query whose first step is to combine a set of tables:
let
Source = Table.Combine({One_foo_bar, Two_foo_bar, Three_foo_bar, Four_foo_bar, Five_foo_bar, Six_foo_bar, Seven_foo_bar, Eight_foo_bar}),
// ...
#"Result" = ...
in
#"Result"
The problem is that not all of the named tables may exist. Any subset of the tables may exist. Those that do exist are in ThisWorkbook
. If any are missing, the M code shown above will throw an error.
If pattern matching can help solve this problem, the table names all follow the pattern *_foo_bar. M does not seem to have support for this type of pattern matching, but I include this statement in case anybody knows something I don't and could utilize this fact to formulate a solution.
How may I modify this code to combine the tables that do exist?