OfficeDev / OfficeDev/office-scripts-docs

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

Open
#760 1 comment 0 reactions 1 assignee View on GitHub

@michelleranmsft is already working on this.

Since Sep 11, 2024.

Needs: attention :wave: Status: in backlog Type: product bug
Dominant language
No language data
Stars
235
Forks
68
Avg merge
6d 7h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.