Hi guys, I tried to user account.get(), but I got Instance of "Account" instead of userId.
final document = databases.createDocument(
databaseId: '---',
collectionId: '---',
documentId: ID.unique(),
data: {
"userid": "$res",
"name": "test1",
"mileage": "test2",
"date":
"${_selectedDate.day}-${_selectedDate.month}-${_selectedDate.year}",
});
}```
When you run and print the user ID what you get?
try{
final account = await account.get();
print(account.$id);
} catch(e){
print(e);
}
When you run account.get you're getting back account model instance
https://appwrite.io/docs/models/account
now it works, thanks
i see
Great
[SOLVED ]Can`t get an userId
Recommended threads
- Synchronous Function Execution Timed Out...
Hi Appwrite team 👋 I’m facing a synchronous function execution timeout issue on Appwrite Cloud and would appreciate some guidance. I executed this function u...
- Push Notification FCM Error
Hello dear people. I tried to integrate Push Notifications into my Flutter App. Everything works fine on Android/iOS Simulator + Testflight but as soon as I s...
- Skip total counts crash the query
Hello, When adding the total parameter (either true, the default, or false) to the listRows function, it raises the following error: `type 'bool' is not a sub...