OfficeDev / office-scripts-docs

Office Scripts Documentation
https://learn.microsoft.com/office/dev/scripts
Creative Commons Attribution 4.0 International
167 stars 45 forks source link

No information if refreshAllDataConnections() is supposed to wait for refresh to finish before it continues. #720

Closed matroosoft closed 6 months ago

matroosoft commented 6 months ago

Article URL (https://learn.microsoft.com/en-us/javascript/api/office-scripts/excelscript/excelscript.workbook?view=office-scripts#excelscript-excelscript-workbook-refreshalldataconnections-member(1))

Describe the problem Documentation does not state whether this method is supposed to wait for the refresh to finish. It appears to not do this.

AlexJerabek commented 6 months ago

Hi @matroosoft,

Thanks for raising this issue. I'll clarify with the product team about this function's expected behavior.

AlexJerabek commented 6 months ago

Hi @matroosoft,

You are correct. The Workbook.refreshAllDataConnections method does not wait for the refresh to complete before proceeding. This mirrors the behavior of the Excel UI.

I will update the docs and close this issue when that change goes through. Please let me know if you have any other questions.

matroosoft commented 6 months ago

Hi @matroosoft,

You are correct. The Workbook.refreshAllDataConnections method does not wait for the refresh to complete before proceeding. This mirrors the behavior of the Excel UI.

I will update the docs and close this issue when that change goes through. Please let me know if you have any other questions.

Hi @AlexJerabek, thanks for your response. I'm not sure if you're in thouch with the team that developed this method. But if so, it'd be great to have it wait till the refresh is finished. Sure, I can refresh the data using Office Scripts but everything after that (reapplying filters, acting upon the data) is immediately executed, therefore rendering the method a bit useless.

It'd be great if you'd be able to pass this information on. Thanks anyway 👍

AlexJerabek commented 6 months ago

Thanks @matroosoft. I've passed along your feedback to the product team. Our first goal is to have parity with the Excel UI, but we'll take your suggestion into consideration.