Forum Discussion
Iterating / changing query parameter to build a merged table
- 8 years ago
Well done! So if you have the function already, all that's left to do is to
1) transform your list of ClientIDs to a table (tab: List Tools -> Convert -> To Table) and
2) add a column (tab: Add Column -> General -> Custom Column
3) In the dialogue, call you function (for each row), passing [Column1] as the parameter that holds the Client ID
4) Expand that column
Easiest would probably be to use an error handler: try YourFunctionCall otherwise null
This would make the code of that step look like this:
Table.AddColumn(YourPreviousStep, "Custom", each try YourFunction([Column1]) otherwise null)
BTW: You can also iterate a list "the traditional way" using List.Transform: https://msdn.microsoft.com/en-us/library/mt253641.aspx
But the advantage of the Table.AddColumn-method in my eyes is that the ClientID is kept in a separate field.
:-)