Solved

GoodData.UI AttributeFilter throwing error 'TypeError: can't access property "meta", displayFormDetails is undefined'

  • 9 July 2021
  • 5 replies
  • 48 views

  • New Participant
  • 3 replies

I am trying to use the AttributeFilter component but after a half second it comes up as “Error loading filter” and in the console I find the following error:

TypeError: can't access property "meta", displayFormDetails is undefined

buildAttributeDisplayForm index.ts:137
    getAttributeDisplayForm index.ts:38
    step tslib.es6.js:100
    verb tslib.es6.js:81
    fulfilled tslib.es6.js:71
    promise callback*step tslib.es6.js:73
    fulfilled tslib.es6.js:71
    promise callback*step tslib.es6.js:73
    __awaiter tslib.es6.js:74
    __awaiter tslib.es6.js:70
    getAttributeDisplayForm index.ts:31
    promise AttributeFilter.tsx:190
    step tslib.es6.js:100
    verb tslib.es6.js:81
    __awaiter tslib.es6.js:74
    __awaiter tslib.es6.js:70
    promise AttributeFilter.tsx:188
    useCancelablePromise useCancelablePromise.ts:139
    React 6
    unstable_runWithPriority scheduler.development.js:653
    React 4
    unstable_runWithPriority scheduler.development.js:653
    React 6
    tsx index.tsx:21
    Webpack 7

 

To strip out any unnecessary unknowns I’ve even tried using it on a pretty much blank page, but the problem persists.

import React, { useEffect, useState } from 'react';import Page from '../components/Page';import * as Ldm from '../ldm/full';import { AttributeFilter } from '@gooddata/sdk-ui-filters';import { newPositiveAttributeFilter } from '@gooddata/sdk-model';const Home = () => {  return (    <Page>      <AttributeFilter        filter={newPositiveAttributeFilter('transactionsentrydate.year', [])}        onApply={() => {}}      />    </Page>  );};

This is using v8.4.0 of the GoodData SDKs. I’ve also tried upgrading to the new v8.5.0 that came out today but that didn’t help.

icon

Best answer by Boris 9 July 2021, 15:53

Hello Shen,

The error is cause by the fact that you are trying to use Attribute Filter component for date attribute. Date attributes are a bit different and have some special properties, so you will have to use Date Filter component to make it work.

 

Best Regards,

Boris from GoodData Support

View original

5 replies

Sorry for the bad code formatting, it’s not letting me fix it. Here’s a link to an image of it: https://imgur.com/a/khe6l4A

Userlevel 2

Hello Shen,

The error is cause by the fact that you are trying to use Attribute Filter component for date attribute. Date attributes are a bit different and have some special properties, so you will have to use Date Filter component to make it work.

 

Best Regards,

Boris from GoodData Support

@Boris Thanks, got it working now!

I had gotten these date attributes from https://localhost:3000/gdc/md/[workspace]/query/attributes which now that I look closer all of the attributes returned by that are dates. How can I query the API to get the non-date attributes?

I have run into some non-date attributes that give me the same error. It seems that’s not the only problem.

 

Edit: Never mind. I was using attribute ids and not the attribute’s corresponding display form id.

Userlevel 2

Hi Shen,

https://localhost:3000/gdc/md/[workspace]/query/attributes should definitely return all of the attributes in the workspace, both date and non-date.

 

Regards,

Boris

Reply