office-scripts-docs icon indicating copy to clipboard operation
office-scripts-docs copied to clipboard

The API you are trying to use cannot be found error returned when any of the Query class methods are called on getQueries

Open jasonfirkus opened this issue 1 year ago • 1 comments

All of the Query class methods do not work with the workbook.getQueries() method; however, these methods all seem to work on an individual Query object returned by workbook.getQuery("name")


To reproduce:
function main(workbook: ExcelScript.Workbook) {
	const queries = workbook.getQueries();
	queries.forEach((query: ExcelScript.Query) => {
		console.log(query.getName()); //replace with any Query class method
	});
}

Errors returned in console: image image image


Working methods when called on `getQuery()`:
function main(workbook: ExcelScript.Workbook) {
	const query = workbook.getQuery("MASTERFORECAST");
	console.log(query.getLoadedToDataModel());
}

Output: image image

jasonfirkus avatar Sep 10 '24 17:09 jasonfirkus

Hi @3levate, thanks for reporting this! Looking into the issue, it appears to be a bug with the API and has been added to our backlog (internal tracking: 9350111). I'll circle back once I have more information to share.

michelleranmsft avatar Sep 17 '24 20:09 michelleranmsft