Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
What can be used instead of for loop to loop through 10000 records which is present in Infotable?
Solved! Go to Solution.
Hi ,
If you need to find row based on some column value , you can use following snippet.
let params = {
t: undefined /* INFOTABLE */,
query: undefined /* QUERY */
};
// result: INFOTABLE
let result = Resources["InfoTableFunctions"].Query(params);
Query can be created as in link .
Hope it helps!!
Hello,
I don't know your context, however you may be able to reduce the number of calls by including the ".Array.prototype.filter()" parameter to one/both of your loops.
infoTableName.rows.toArray().filter(singleRow => singleRow.field == true).forEach(singleRow => {
//do magic
});
Hi ,
If you need to find row based on some column value , you can use following snippet.
let params = {
t: undefined /* INFOTABLE */,
query: undefined /* QUERY */
};
// result: INFOTABLE
let result = Resources["InfoTableFunctions"].Query(params);
Query can be created as in link .
Hope it helps!!
Hello,
I think previous answers provide the information that you wanted.
But I wanted to post this here as well if it might help decide on the best way of looping: Tips-and-Tricks-for-ThingWorx-Developers-Dependencies-JavaScript
#2 in this link will provide some information regarding the different loop options you have.
Regards,
Jens