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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Import Infotable to Datatable

WilsonT
13-Aquamarine

Import Infotable to Datatable

Hi Thingworx Gurus,

 

I would like to know if there is a way to import an infotable into a datatable?

 

The reason is that I would like to display the infotable content into Advanced Grid widget and to enable filtering and sorting capabilities. It seems like the filtering and sorting features can only works when the data source is Datatable. If there is anyway that can have an infotable to work with Advanced Grid widget's filtering and sorting, would appreciate if you can share.

 

*Note: I have read this post and it seems that the suggested way (using InfotableFunction resource) is not working for me. 

ACCEPTED SOLUTION

Accepted Solutions

The Values part is the infotable input.

 

If you utilize the service in a mashup, you can actually bind an infotable to its input area.

And in the script it looks like this:

Things["PartsTable"].AddDataTableEntries({
sourceType: undefined /* STRING */,
values: undefined /* INFOTABLE */,
location: undefined /* LOCATION */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
});

View solution in original post

5 REPLIES 5

Use AddDataTableEntries service can add an infotable to a Datatable, or what else do you mean by Import?

WilsonT
13-Aquamarine
(To:zyuan1)

Hi Ryan,

 

Thanks for the response.

 

May I know how to use AddDataTableEntries service to add an infotable to a DataTable? If scripting is required, appreciate if you can share a sample with me.

 

Thanks.

It's the default and first service in the list which you can see in a Datatable entity,  infotable is one of it's input, and it doesn't need much customized script, you can test on the composer directly.

 

Only note that the infotable and Datatable entity share the same Datashape.

WilsonT
13-Aquamarine
(To:zyuan1)

Hi Ryan,

 

Looking at the input parameters of AddDataTableEntries service, I dont see any input as Infotable. How can I define an Infotable in this case?

 

WilsonT_0-1590653004557.png

 

The Values part is the infotable input.

 

If you utilize the service in a mashup, you can actually bind an infotable to its input area.

And in the script it looks like this:

Things["PartsTable"].AddDataTableEntries({
sourceType: undefined /* STRING */,
values: undefined /* INFOTABLE */,
location: undefined /* LOCATION */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
});

Announcements


Top Tags