cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Removing data table columns from Grid

jensc
17-Peridot

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

1 ACCEPTED SOLUTION

Accepted Solutions
DanZ
15-Moonstone
(To:jensc)

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.

View solution in original post

4 REPLIES 4

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

DanZ
15-Moonstone
(To:jensc)

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.

jensc
17-Peridot
(To:DanZ)

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

DanZ
15-Moonstone
(To:jensc)

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.

Top Tags