Skip to content

filter method getFieldAsync does return 401 on super store example #376

@LingVuDev

Description

@LingVuDev

Description

I have faced an issue where I wanted to get the field that was used for a filter. For this I found in the API reference this method getFieldAsync(). But instead of returning the field object, I always get unauthorized response, even though everything else from the API does work.

What I am using

Workbook: SuperStore - Shipping

My implementation

export async function getColumnRoles(worksheet: Worksheet): void {
  let metaInfo: any = {};
  const filters = await worksheet.getFiltersAsync();
  console.log(filters);
  // This gives me the error 
  console.log(await filters[0].getFieldAsync());
}

Request (simplified)

Request URL: [...]/w/Superstore/v/Shipping/sessions/A3093F7D1A1D4B409E9D8146FC983557-0:0/commands/tabdoc/get-datasource-pres-model
Request Method: POST
Status Code: 401 
Remote Address: [...]
Referrer Policy: strict-origin-when-cross-origin

My goal in the end is to find out whether the filter is assigned to a field which is a dimension or measure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions