Android Question [Solved] Pocketbase CRUD issue

kgf

Member
Licensed User
Longtime User
Hi

I am connecting and authenticating fine to a local pocketbase.

I can also post/insert no problem
B4X:
Dim Insert As Pocketbase_DatabaseInsert = xPocketbase.Database.InsertData.Collection("species")
Insert.Parameter_Fields("vernacularName,species_id")
Dim InsertMap As Map = CreateMap("vernacularName":"Test","species_id":"999")
Wait For (Insert.Insert(InsertMap).Execute) Complete (DatabaseResult As PocketbaseDatabaseResult)
xPocketbase.Database.PrintTable(DatabaseResult)

The pocketbase log shows status 200 and the record is inserted
POST
/api/collections/species/records?fields=vernacularName,species_id

But when I try to read the same collection with
B4X:
Wait For (xPocketbase.Database.SelectData.Collection("species").GetFullList("vernacularName")) Complete (DatabaseResult As PocketbaseDatabaseResult)
xPocketbase.Database.PrintTable(DatabaseResult)

I get from the pocketbase log
1741788868711.png

It seems the API is missing the collection name as the API reference suggests it should be like /api/collections/species/records/ not /api/collections/records
Or am I missing something, the permissions are set and I can insert to that table/collection.

Thanks
 

kgf

Member
Licensed User
Longtime User
Works for me.


B4X:
    Wait For (xPocketbase.Database.SelectData.Collection("species").GetFullList("vernacularName")) Complete (DatabaseResult As PocketbaseDatabaseResult)
    xPocketbase.Database.PrintTable(DatabaseResult)

Response

1741855772165.png


Thank you
 
Upvote 0
Top