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/
Thanks for the response Imke, much appreciated :). All I was after was confirmation that when invoking a function there was no way to keep the invoked name rather than the "Invoked Function" name it gives the new query. In previous versions of the desktop, a function would have called itself and updated the same query not create a new one thats all.
To elaborate a bit more, I was using a web data source to query a json based API site. The max number of values I could return on each call was 50 but didn't know specifically how many invokes I would need. I created a function with the web URL and used a parameter for the number of the page in the header which is why I needed to invoke so many times. I then appended the functions to a new table and renamed that, turning the rest of the invoked functions off. This wasn’t ideal but did the job. It would have been useful if they were called that actual name of the function thats all.
Thanks again for responding!
Raf
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/
- Sabo256w4 years agoFrequent Visitor
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!
- RafDelgado10 years agoHelper II
AHH! Now I get you! What an awesome way of going about it :). Will give it a shot and try it that way, thanks again for the suggestion :)