Error when using data tables

Hi,

When I run the code in this project:

https://studio.code.org/projects/applab/lZsPY-1MCD880SVgoe0lxP1WS1bBIn4NWJRQ_vxduPg

I keep getting this error message when I try to set the image and the picture does not appear.

WARNING: Line: 11: setImageURL() url parameter value (undefined) is not a string.

When I copy and paste the image address from the data table it works. I have copied the code from the examples so I am not sure what I am getting wrong. Thanks for your help. Andrew

Hi @andrew.c.wilson,

I spent a long time trying to fix this code. I set up console.log statements to find out what things were, and they kept coming up undefined. Weird.

Then I looked at Line 1 again:
image

What were those brackets around getColumn() intended to do? I took them out & the code worked great (link to my remix)! I’d encourage your student to look for simple typographical errors that break the project.

PS: Look at lines 6 & 9 again, and consider what happens to the dog whose pic is at index 0. Think about how to account for that, and then look at how I modified my code.

Hope that helps!
–Michael K.

1 Like

Hi,

Thanks so much. Code is working perfectly! This is the first time I posted and I am really impressed with the support. I truly appreciate the time you both put into your replies. Thanks again. Andrew

2 Likes

All of my AP CSP students are receiving the same error about the data tables

Code.org must not be working because we are currently having the same issues.

Yeah, I’m getting the same issue. Must be an issue on their end.

I’m getting the same issue.

The issue has been fixed! See the post here.

Thank you!

–Michael K.