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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

For Each function not found on thingworx

Janicen
16-Pearl

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