Forum Discussion
Incremental refresh for custom connector with call to REST API: RangeStart and RangeEnd
- 2 years ago
Finally we found the solution:
It is all up to query folding. The article helped a lot:
https://bengribaudo.com/blog/2022/01/20/6500/power-query-m-primer-part-23-query-folding-i
One does not need to define RangeStart nor RangeEnd parameters anywhere in the connector.
Instead one should implement Table.View as shown here:
https://learn.microsoft.com/en-us/power-query/samples/trippin/10-tableview1/readmeThe only missing information is that one need to implement OnSelectRows.
Further information:
https://community.fabric.microsoft.com/t5/Power-Query/Query-folding-Table-View-handler-function-to-filter-rows-add/td-p/3154149br, Michael
RangeStart and RangeEnd must be included in the construction of the URL. Note that if your query doesn't fold (which is rather likely to happen here) then you will not get any performance gains from Incremental Refresh.
I include the parameters in the url. The problem is that the parameters are always empty. Is it the right way to defne them as I did in the original post?
- lbendlin2 years agoSuper User
Sounds like you didn't mark the table as incremental refresh yet and didn't publish the pbix?
- emikelsoft2 years agoHelper I
I aslo marked the table as incremental refresh and published the pbix.
I really comes down to the question if the definition of the params in the custom connector is at the right place and has the right naming.
Is this the right way of doing it:
shared Foo.Contents = Value.ReplaceType(FooImplementation, type function (Url as Uri.Type, optional RangeStart as nullable datetime, optional RangeEnd as nullable datetime) as any);- lbendlin2 years agoSuper User
RangeStart and RangeEnd must be included in the construction of the URL. I don't see that - you seem to be supplying them separately.