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.
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.