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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

How to get certain number of rows from Infotable

amittal1
9-Granite

How to get certain number of rows from Infotable

Hello,

Is there a way by which we can get certain limited number of rows from infotable, without writing any custom service/code.

For example I have 10 rows in my infotable, and I want first 5 rows, is there any service available which I can use to get that?

Thanks in advance

Regards

Aditya Mittal

ACCEPTED SOLUTION

Accepted Solutions

Hi, you can get a limit number of rows by controlling the Maxitem in the infotable query services, or add a snippet to the existing infotable result:

 

var params = {
maxItems: undefined /* NUMBER */,
t: undefined /* INFOTABLE */
};

// result: INFOTABLE
var result = Resources["InfoTableFunctions"].TopN(params);

View solution in original post

3 REPLIES 3
posipova
20-Turquoise
(To:amittal1)

You could probably set your query to max rows 5. Other than that, we don't have any specific out of the box service available for this use case.

Hello,

Thanks for your reply. I would like to know how to write a query to get the maximum number of rows from a infotable. Even using a query will work for me, because in any case I am using a query on my infotable, so I can add one more parameter for Max rows, that is fine for me. I usually refer following link whenever I have to write a query:

https://support.ptc.com/cs/help/thingworx_hc/thingworx_7.0_hc/index.jspx?id=QueryParameterforQueryServices&action=show

If there is some other reference, please share, it would be helpful.

Many thanks

Regards

Aditya

Hi, you can get a limit number of rows by controlling the Maxitem in the infotable query services, or add a snippet to the existing infotable result:

 

var params = {
maxItems: undefined /* NUMBER */,
t: undefined /* INFOTABLE */
};

// result: INFOTABLE
var result = Resources["InfoTableFunctions"].TopN(params);

Announcements


Top Tags