So, I have a custom widget, where the user can select a layer from a map. From there he can choose a field, an operator and input a value. This creates a query for the layer and I set Field Out to "*". So basically, I am retrieving all items that match the query with all their fields. I would like to send this response, all the items with all their fields with respective values to the table widget.
widget.tsx:
try {
const result = await layer.queryFeatures(query);
const resultData = result.features.map((feature) => ({
attributes: feature.attributes,
geometry: feature.geometry,
}));
console.log("result=", result);
props.dispatch(appActions.widgetStatePropChange("attribute_table", "queryResult", resultData));
highlightAndZoomToFeatures(result.features);
const dataSourceManager = DataSourceManager.getInstance();
const outputDsId = `${props.id}-output`;
const outputDataSource = dataSourceManager.getDataSource(outputDsId) as FeatureLayerDataSource;