Back

How i can add the data in userId List?

  • 0
  • Databases
  • Flutter
Nikunj Panchal 🌿
1 Jun, 2023, 06:38

When i add second userId into list it will update the last userId. But I want to add new userId into List How i can achive that ?

TL;DR
The user wants to know how to add data to a userId List. They are asking for help because currently, when they add a second userId to the list, it overwrites the last userId instead of adding a new one. The solution is to create a function and call it from the client, sending the payload with the new data. This way, the new userId will be added to the list instead of overwriting it.
D5
1 Jun, 2023, 07:14

Yo will need to create a function

D5
1 Jun, 2023, 07:15

And instead of creating a document directly with the SDK, you will need calling from your client the function, and send the payload with the corresponding data

D5
1 Jun, 2023, 07:19

You can get the userID from the one who triggered the function with a variable: https://appwrite.io/docs/functions#functionVariables

D5
1 Jun, 2023, 07:19

Concretely APPWRITE_FUNCTION_USER_ID

D5
2 Jun, 2023, 14:10

@Nikunj Panchal 🌿 do you need additional information?

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