fix(basic.gblib): Trying to find invalid cell value on .xlsx being filtered.
This commit is contained in:
parent
44a221b07c
commit
3f0b020155
1 changed files with 18 additions and 15 deletions
|
@ -290,8 +290,8 @@ export class SystemKeywords {
|
|||
* loop
|
||||
*
|
||||
*/
|
||||
public async find(file: string, ...args ): Promise<any> {
|
||||
GBLog.info(`BASIC: FIND running on ${file}...`);
|
||||
public async find(file: string, ...args): Promise<any> {
|
||||
GBLog.info(`BASIC: FIND running on ${file} and args: ${JSON.stringify(args)}...`);
|
||||
let [baseUrl, client] = await this.internalGetDriveClient();
|
||||
const botId = this.min.instance.botId;
|
||||
const path = `/${botId}.gbai/${botId}.gbdata`;
|
||||
|
@ -308,18 +308,21 @@ export class SystemKeywords {
|
|||
const columnName = filter[0];
|
||||
const value = filter[1];
|
||||
let sheets = await client
|
||||
.api(`${baseUrl}/drive/items/${document.id}/workbook/worksheets`)
|
||||
.api(`${baseUrl}/drive/items/${document.id}/workbook/worksheets`)
|
||||
.get();
|
||||
|
||||
let results = await client
|
||||
let results = await client
|
||||
.api(`${baseUrl}/drive/items/${document.id}/workbook/worksheets('${sheets.value[0].name}')/range(address='A1:Z100')`)
|
||||
.get();
|
||||
|
||||
// Increments columnIndex by looping until find a column match.
|
||||
// Increments columnIndex by looping until find a column match.
|
||||
|
||||
let columnIndex = 0;
|
||||
let columnIndex = 0;
|
||||
const header = results.text[0];
|
||||
for (; columnIndex < header.length; columnIndex++) {
|
||||
|
||||
GBLog.info(`FIND DEBUG header: ${header[columnIndex]} columnName: ${columnName}`);
|
||||
|
||||
if (header[columnIndex].toLowerCase() === columnName.toLowerCase()) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue