Skip to main content
17-Peridot
June 13, 2023
Solved

Removing data table columns from Grid

  • June 13, 2023
  • 2 replies
  • 2353 views

Hello Community.

 

For a long time now I have noticed that when using a data table as a data source for a grid, there are some columns that show up in the grid even though you perhaps use a data shape in your service result that do not include these columns.

 

Example:

jensc_0-1686639432551.png

 

Is there any way of hiding/removing these without adding them to the data shape or having to loop over each row and removing field?

 

Thanks,

Jens

Best answer by DanZ

In the "Output" section of the service just select "Is Data table" as Infotable Type. Then you are able to hide those fields in the Grid-Widget without explicit defining or removing them. 🙂

2 replies

19-Tanzanite
June 13, 2023

Hi @jensc 

 

I also faced a similar issue with DataTable. I used to remove the fields in my service so you don't have to iterate over rows or add fields to Datashape.

 

// Remove default field from result
result.RemoveField('timestamp');
result.RemoveField('source');
result.RemoveField('tags');
result.RemoveField('key');

 

/VR

DanZ15-MoonstoneAnswer
15-Moonstone
June 13, 2023

In the "Output" section of the service just select "Is Data table" as Infotable Type. Then you are able to hide those fields in the Grid-Widget without explicit defining or removing them. 🙂

jensc17-PeridotAuthor
17-Peridot
June 13, 2023

Hello @DanZ,

 

This worked great!

 

Before changing to "Is Data table":

jensc_0-1686647588409.png

 

After changing to "Is Data table":

jensc_1-1686647638711.png

Perfect, this is exactly what I was looking for!

I can't say I understand what changing this property does exactly, so not sure if it will work in all situations, but for this case, it works great.

 

Thanks,

Jens

15-Moonstone
June 13, 2023

Like the datashape itself it just gives context for the mashup composer what columns are expected. Every data table has those "key, timestamp, location etc." columns. So it will just add those "metadata" information for this infotable output.

 

But that is only my interpretation.