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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

For Each function not found on thingworx

Janicen
15-Moonstone

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,

 

 

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

Announcements

Top Tags