Julia Chen
09/17/2025, 11:56 PMgetItems(). Since the first parameter of getItems() supports either an Attribute or a Measure (forItems(items: IAttributeOrMeasure[], filters?: INullableFilter[])), I tried passing Attributes (e.g., Attribute1) to display a count of Attribute1 in each Category.
This works fine when I use a Measure (with a Metric ID in full.ts), but when I try it with Attributes only (no Measure involved), I get a 400 error from the execute call.
In my case, I need to pull the data directly from a view (Md.Category and Md.Attribute), and I do have the Metric ID available in full.ts.
Can anyone help with the correct approach to retrieve Attribute data?
backend
.workspace(workspace)
.execution()
.forItems([Md.Attribute1], filters)
.withDimensions(newDimension([Md.Category]))
.execute();kapa.ai
09/17/2025, 11:56 PMJulia Chen
09/18/2025, 12:31 AMkapa.ai
09/18/2025, 12:32 AMkapa.ai
09/18/2025, 12:32 AMJulia Chen
09/18/2025, 1:20 AMkapa.ai
09/18/2025, 1:20 AMkapa.ai
09/18/2025, 1:20 AMfacade.data().slices().toArray() returns an empty array ([]), it means that there are no data slices available in the data view. This typically happens when the execution result is empty—either because the query returned no data (due to filters, data model, or other reasons), or because the execution definition did not produce any slices (for example, if there are no attributes in the result, or the data set is empty). According to the documentation, the slices() method returns a collection of data slices available in the data view, and toArray() will return an empty array if there are no data slices [[IDataSliceCollection.toArray() method](https://sdk.gooddata.com/gooddata-ui-apidocs/v10.41.0/docs/sdk-ui.idataslicecollection.toarray.html#idataslicecollectiontoarray-method)]. Possible reasons for empty slices: - The execution returned no data (e.g., due to filters excluding all data). - The execution definition did not include any attributes, so there are no slices to return. - The data set itself is empty for the given query. What you can do: - Double-check your execution definition to ensure you are including attributes. - Verify that your filters are not too restrictive. - Check that your data model contains data for the attributes and measures you are querying. If you need to debug further, you can log the raw result or check the status and error properties from your data fetching hook to see if there are any clues about why the result is empty [[Working with the results](https://www.gooddata.com/docs/gooddata-ui/latest/learn/visualize_data/create_custom_visualizations/#working-with-the-results)]. If you provide more details about your execution definition or filters, I can help you troubleshoot further.Ashley Rodan
09/18/2025, 5:36 AMMoises Morales
09/25/2025, 12:34 PM