Back

[SOLVED] create array string attribute in dart

  • 0
  • Self Hosted
  • Flutter
  • Databases
appwrite_newbie
3 Jul, 2023, 18:22

In dart how do we create array of string attribute in AppWrite collection In my app I’m using collections to create chatrooms for chat conversations where in I need to keep array string for saving multiple image ids or links <#634237163986485249>

TL;DR
The user was asking how to create an array string attribute in Dart for an AppWrite collection. The solution was to pass a `List<String>` as the array parameter when using the `createStringAttribute` function.
Drake
3 Jul, 2023, 23:52

Uhh have you tried passing a List<String>?

appwrite_newbie
4 Jul, 2023, 04:26

We need to use one of this server functions right ? Do you mean , I have to create a string attribute and past List<String> to it ?

Drake
4 Jul, 2023, 05:11

Oh sorry, I thought you meant how do you create/update a document.

You will need to create a string attribute. One of the options is to make it an array or not

appwrite_newbie
4 Jul, 2023, 05:26

Ok so just for the confirmation

  1. I need to use this createStringAtrribute function but I can pass an array to it while creating a document right ?

Future result = databases.createStringAttribute( databaseId: '[DATABASE_ID]', collectionId: '[COLLECTION_ID]', key: '', size: 1, xrequired: false, );

Drake
4 Jul, 2023, 05:30

Yes, correct.

Size should be the length of each string.

You're missing the array option

appwrite_newbie
4 Jul, 2023, 05:47

“You’re missing the array option”

sorry I didn’t get this statement

appwrite_newbie
4 Jul, 2023, 06:20

I got it array parameter is present in the function Thank you @Steven

Drake
4 Jul, 2023, 15:36

[SOLVED] create array string attribute in dart

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more