ChewbaccaOriginal post
Rank 1: Thread
Hi guys, I tried to user account.get(), but I got Instance of "Account" instead of userId.
Plain text
final document = databases.createDocument( databaseId: '---', collectionId: '---', documentId: ID.unique(), data: { "userid": "$res", "name": "test1", "mileage": "test2", "date": "${_selectedDate.day}-${_selectedDate.month}-${_selectedDate.year}", }); }```Summary
User was not able to get the userId when using the `account.get()` method. They were getting an instance of "Account" instead. The solution was provided to print the user ID using the following code:
```dart
try{
final account = await account.get();
print(account.$id);
} catch(e){
print(e);
}
```
Additionally, there was a separate issue mentioned where the user was creating a document in a database but not retrieving the userId. No solution was provided for this issue.