Skip to main content
Apr 17, 2020 6:34 PM UTC
Solved

JSON InfoTable Property Error

I am trying to store data being pulled in from a JSON file into an InfoTable and I keep getting this error with one of my values from the JSON file: 

 

 Error executing service create-my-infotable. Message :: TypeError: Cannot read property "isbn" from undefined - See Script Error Log for more details.
 
I attached my code that was created with the help of the article: https://www.ptc.com/en/support/article/CS179012 and the JSON file.
 
Thank you!
 
 
 
 
 
 
Apr 20, 2020 6:52 AM UTC

Had you tried data.array[i].isbn?

Maybe better you print the JSON content to the log console:

 

logger.info(" JSON content "+JSON.stringify(data));

 

3 replies

Apr 17, 2020 7:43 PM UTC

Hi! How/where is your "data" variable set? As an input to the service or as code above the screenshot?

Apr 20, 2020 6:52 AM UTC

Had you tried data.array[i].isbn?

Maybe better you print the JSON content to the log console:

 

logger.info(" JSON content "+JSON.stringify(data));

 

Apr 20, 2020 4:33 PM UTC

This worked for me! Thank you so much.