I’m happy to help with this but without your data, I’d just be guessing. Can you post an example .toe or send to ivan@derivative.ca. I definitely need to know exactly what the incoming data looks like and it would help to see a mock-up of how you’d like the final table to look.
Also, it would help a lot to know what the errors are you are getting.
Also doing a printout of your record to know how it looks like will help alot.
I’m simply suspecting that photos is an empty array, so you are getting an error because index is out of bounds. But could be anything, really.
[shoot, pulled down the screen cap so I can redact it first]
(I can send you the Airtable API for that specific base, which formats the same outgoing data more nicely, but I hesitate to send that over the open inter webs.)
The Airtable base is going to be updating live, as folks upload photos through JotForm (which then sends it to Airtable)
All I need is the “url” data inside “photos” which is inside “fields” parsed into a tableDAT, where I can then plug it into a moviefileInTOP. I will then use a ReplicatorCOMP, so as new records come into the airTable-Base → tdTable, it all updates live.
As soon as folks send a photo it shows up on screen.
I got it all working last year. However, I’m now on a MBP M1, the latest release of TD. Also, what was air table-python-wrapper, is now pyairtable. I know just enough to get myself in trouble.
In your first record, “fields” is empty. So you either need to do a careful check, like:
for records in table.all():
if records['fields'] and records['fields']['photos'] and records['fields']['photos'][0] and records['fields']['photos'][0]['url']:
locTable.appendRow([records['fields']['photos'][0]['url'],])
or a brute force check like:
for records in table.all():
try:
locTable.appendRow([records['fields']['photos'][0]['url'],])
except:
pass
Just a little note on the try/except block:
It is bad practice to implement a catch-all except as this would obfuscate other errors as well.
Instead, except specific events like KeyError or IndexError.
In general, you should always use careful error checking unless you really don’t care what the error is. Also, you should keep anything inside the “try” clause as simple as possible because, as pointed out, you won’t see any effects of other errors you may have missed.