Forum Discussion
Invoked Function Name in BI Desktop Queries
- 10 years ago
Hi Raf,
I think we're on the same page here - just that I didn't make myself clear enough :-)
Instead of using a function for creating the multiple webcalls with different page numbers, create a table with those parameters instead: manually, or like this #table({"URL", "PageNumber"},{{"yourURL", 100}, {"yourURL", 200}}) or dynamically with List.Generate or so.
Then you add a custom column where you invoke your function (with those 2 (or more) parameters from your columns passed into):
myWebCallFunction([URL], [PageNumber])
Check out this post: http://exceleratorbi.com.au/power-query-combine-web-pages/
There Matt first creates the function (which you probably have already) and then from 1:20 onwards first creates his parameter table (which just contains a list of different years) and then invokes his (1) function from within a calculated column.
Edit: So your page numbers will be like Matt's Year numbers.
BTW: You can use List.Generate for an iterative calling of your web-pages where it checks with each call if there is more content to come and then perform the next step if yes or stop if no. Had that somewhere in the TechNet-forum but cannot remember any more. But maybe Chris' article will tell you all you need already: https://blog.crossjoin.co.uk/2014/06/25/using-list-generate-to-make-multiple-replacements-of-words-in-text-in-power-query/
Hi Raf,
I think we're on the same page here - just that I didn't make myself clear enough :-)
Instead of using a function for creating the multiple webcalls with different page numbers, create a table with those parameters instead: manually, or like this #table({"URL", "PageNumber"},{{"yourURL", 100}, {"yourURL", 200}}) or dynamically with List.Generate or so.
Then you add a custom column where you invoke your function (with those 2 (or more) parameters from your columns passed into):
myWebCallFunction([URL], [PageNumber])
Check out this post: http://exceleratorbi.com.au/power-query-combine-web-pages/
There Matt first creates the function (which you probably have already) and then from 1:20 onwards first creates his parameter table (which just contains a list of different years) and then invokes his (1) function from within a calculated column.
Edit: So your page numbers will be like Matt's Year numbers.
BTW: You can use List.Generate for an iterative calling of your web-pages where it checks with each call if there is more content to come and then perform the next step if yes or stop if no. Had that somewhere in the TechNet-forum but cannot remember any more. But maybe Chris' article will tell you all you need already: https://blog.crossjoin.co.uk/2014/06/25/using-list-generate-to-make-multiple-replacements-of-words-in-text-in-power-query/
Very elegant solution!
I've been stuck with a similar issue, where I had to invoke ALOT of functions with many tables and the append all together. With this I can just append and clean at the same time.
Thanks!