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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

For Each function not found on thingworx

Tomellache2B
14-Alexandrite

For Each function not found on thingworx

Hi Everyone,

 

I am trying to call the forEach(myFunction) {

}

 

But I keep getting this error: : TypeError: Cannot find function forEach in object com.thingworx.types.InfoTable@e5e813bf.

 

Is this a version issue?

Please assist me with this

 

Many Thanks,

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Try with following,

var infoTable = [INFOTABLE DATA];
infoTable.rows.forEach(myFunction);

View solution in original post

2 REPLIES 2

Try with following,

var infoTable = [INFOTABLE DATA];
infoTable.rows.forEach(myFunction);

Hello,

 

To extend on @Sathishkumar_C's answer:

 

This error indicates that you are trying to use the forEach function on an object which doesn't contain this function.

My experience is that it is mainly used on arrays, and if you are trying to use it on an infotable, the array is called "rows" as explained in Kumars post.

 

It does however seem to be possible to use it on objects, it is just not commonly used.

 

Regards,

Jens

Top Tags