Forum Discussion
Scheduled Refresh Custom Function
- 7 years ago
It looks like you may be running into the issue I describe here:
Can you try rewriting so that Web.Contents uses the Query option for your parameters?
Chris
- 7 years ago
Ah, I didn't see that you are doing authentication using a header - no, I don't think it will work (see the comment by danzrust on the blog post). Sorry!
Chris
Anonymous the suggestion you make to use it in a query parameter, how do you that?
Currently I use an API query to receive IDs that need to be used in the second query
So for example:
Source = Json.Document(Web.Contents("URL" & "ParamX=" & param1, [Headers=[Authorization="Bearer " & #"Token"]]))That results in IDs that need to be used in the second query. Basicly for each ID from the above code, do the code below:
Source = Json.Document(Web.Contents("URL2" & "&ParamY=" & param2 , [Headers=[Authorization="Bearer " & #"Token"]]))Can you tell me how to do that using query parameters?
Because the following code still fails in the web refresh as it cannot register my credientials:
Source = Json.Document(Web.Contents("URL" & "url_part_1", [Headers=[Authorization="stringtoken"]])),
It says it cannot be validated in the online environment, while locally it works perfectly fine.
The other question also remains on why the scheduled refresh is not working!
HI Soldexio,
If your query need to invoke multiple times based on result data, I think this scenario not suitable to transform to parameterized query.
It means you need to manually write custom steps to invoke api url with different result data.
Regards,
Xiaoxin Sheng
- Soldexio7 years agoHelper I
Hi Anonymous,
Could you elaborate what you mean with manually write custom steps? I do want to be able to schedule a refresh and the way I currently did this, does not support scheduled refresh.
Also, do you know what the plans are to schedule refresh on custom functions? Because atleast for my usage of Power BI (and that of the company) these are mandatory to work really. Manual refreshes cannot be done for multiple dashboard that require daily updates!
Kind regards!
- Soldexio7 years agoHelper I
Hi Anonymous,
Any update on this? Looking to get this to production asap!
Kind regards,
Soldexio
- Anonymous7 years agoNot applicable
Hi Soldexio,
Your scenario is similar as below, it need to analytics response data to invoke them to get next data.
How to perform loop in M Query and collate result of the same
It is a loop operation which only suitable with custom functions so you can't use it on power bi service side.>>Could you elaborate what you mean with manually write custom steps?
If your query has fixed request frequency, you can manually write custom steps to invoke api and analytics response data.
If frequency are dynamics and you can't confirm how many times it invoke, my suggestion not works for this scenario, you had to use custom function to achieve these operations and can't works on service side.
Regards,
Xiaoxin Sheng