JSON InfoTable Property Error
‎Apr 17, 2020
02:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Apr 17, 2020
02:34 PM
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!
Solved! Go to Solution.
Labels:
- Labels:
-
Coding
-
Troubleshooting
-
TWX Dev Portal
ACCEPTED SOLUTION
Accepted Solutions
‎Apr 20, 2020
02:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Apr 20, 2020
02:52 AM
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 3
‎Apr 17, 2020
03:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Apr 17, 2020
03:43 PM
Hi! How/where is your "data" variable set? As an input to the service or as code above the screenshot?
‎Apr 20, 2020
02:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Apr 20, 2020
02:52 AM
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
12:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Apr 20, 2020
12:33 PM
This worked for me! Thank you so much.