This is how I am adding documents in my collection, but my function is failing to execute Is there something wrong in this approach?
for i in range(len(name_list)):
result = databases.create_document('64776905e1fxxxx', '64776913a740bxxxx', ID.unique(), data = {
'name': name_list[i],
'logo': logo_list[i],
'title': title_list[i],
'location': location_list[i]
},)
What's the error?
no error
its just failing
Can you try wrap your code with try catch
So the error will be send back?
Like this
https://discord.com/channels/564160730845151244/1113545780863701013/1113549759416897708
There's no info in the any of the logs tabs?
nopw
when I use try catch
it returns
{"message":"list index out of range","success":false}
That's good
It means that one of the lists doesn't contain as many items as name_list list.
Try to output the len of each list. to be sure they all have the same length.
oh yes you are right, thanks, that was dumbπ
Recommended threads
- listRows result parsing issue
I'm using Appwrite Dart SDK "24.2.0". When I perform a listRows call in dart, I have this reponse in JSON: in " Future<models.RowList> listRows()" { "total" :...
- Index for combination of columns
How am i suppposed to apply index so that combination of two columns alwasy remain unique in appwrite table though console
- Broken Flutter SDK >=24.1.0
Row.fromMap now does: ``` data: Map<String, dynamic>.from(map["data"] ?? {}) ``` But Appwrite Cloud TablesDB row responses return custom row columns flattene...