Forum Discussion
Power Query only refreshes after refreshing preview
- 2 years ago
I solved the issue, but it raises another question!
The process to download data from Anaplan is as follows:
- Authenticate and get an authentication token. This is used in future API requests.
- Trigger the download process in Anaplan. This only starts the download on the server side. No data is sent to Power Query.
- Download the data (from step 2).
- Transform data as required.
Step 2 above is represented by this line:
response2 = Json.Document(webdata2),
This line is then no longer used in the query. All this does is start the download process on the server side, it is not used again in the query. Because it is not used, I don't think Power Query bothers to run it when refreshing the query. Why would it? The line doesn't impact the query. BUT, from an API perspective, I need this to be updated each time.
This is why refreshing the preview worked, it forced Power Query to update this value and hence re-trigger the download process.
That is odd. A quick test I would do would be to copy your mytoken1 into a separate query with a different name, and then reference that query instead.
Pat
- sesame54862 years agoFrequent Visitor
Agreed weird behaviour. It seems that Power Query is being "lazy" and re-using the old authentication token. I tried this but it didn't work. Tried both as a function and query.