Skip to main content
17-Peridot
Jun 13, 2023 6:58 AM UTC
Solved

Removing data table columns from Grid

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

DanZAnswer
15-Moonstone
Jun 13, 2023 8:40 AM UTC

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. 🙂

4 replies

19-Tanzanite
Jun 13, 2023 8:29 AM UTC

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

Translate
DanZ15-MoonstoneAnswer
15-Moonstone
Jun 13, 2023 8:40 AM UTC

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. 🙂

Translate
jensc17-PeridotAuthor
17-Peridot
Jun 13, 2023 9:15 AM UTC

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

Translate
15-Moonstone
Jun 13, 2023 9:33 AM UTC

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.

Translate