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

Exclude columns from Dynamic Infotable on the fly

TanmeyTWX
Moonstone

Exclude columns from Dynamic Infotable on the fly

Hi,

As we know,using Dynamic Infotable doesn't provide the option of attaching a Datashape to the result or we can't. Hence,we can't configure columns of the Grid,using that dynamic Result.

Is there any way to exclude or control the columns of the dynamic Infotable before sending it to the Output or after binding it in the Mashup?

Anyone came across similar requirement?

Thanks,

Tarun

8 REPLIES 8

Re: Exclude columns from Dynamic Infotable on the fly

On the grid you set Show All Columns,

And then on the Server Side Service which returns the Infotable with dynamic fields you just don't set any DataShape.

Then on this service you can Add/Remove Fields as desired with the correspondent Snippets.

Re: Exclude columns from Dynamic Infotable on the fly

Hi Carles,

Show All Columns is required in case of dynamic infotable output but that doesn't provide the option to exclude columns within the Mashup.

And on the service side,I'm getting different columns everytime user does a selection from the Mashup,which is almost unknown.

Re: Exclude columns from Dynamic Infotable on the fly

What you want to do? You want that the user from the mashup has a Columns Picker on a Dynamic Columns Grid?

That's not a problem, the service which returns the dynamic fields should have an input parameter with the Hidden fields, and just on the service use RemoveField snippet.

Re: Exclude columns from Dynamic Infotable on the fly

I'm displaying a Thing Property values which will return property values of all the ThingShapes attached to it,as well.

This Thing will always return some of its common data,say property1,prop2,.....prop10. And, Corresponding ThingShapes data as well.

I want to display the property values of a particular ThingShape attached to it as well as just few common properties of the Thing but not all the 10 properties.

Re: Exclude columns from Dynamic Infotable on the fly

Remote the undesired columns, which it's the problem?

Re: Exclude columns from Dynamic Infotable on the fly

Carles,

I tried the "hardcode" way.

Using "RemoveField" method,mentioned the names of the undesired columns of the Thing and it worked. But I'm afraid,if the field name or entire list of properties changes in future,I would have to edit the service script again for the entire list of properties

Re: Exclude columns from Dynamic Infotable on the fly

You can discover dynamically the Fields that an Infotable has:

var iLF ;

    if ((infotableLeft.dataShape==null)||(infotableLeft.dataShape==undefined)) {

        iLF = infotableLeft.ToJSON().dataShape.fieldDefinitions;

    } else {

        iLF = infotableLeft.dataShape.fields;

    }

Re: Exclude columns from Dynamic Infotable on the fly

The other thing you can do is the reverse approach, using the GetNamedProperties or GetNamedPropertyValues services, to return only those properties you care about, rather than removing the ones you don't. Either should

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.