Skip to content
Back

Not getting data

  • 0
  • Cloud
Raman
31 May, 2026, 01:40

IDK what the issue is but I am stuck at a weried but that I am calling this function

TypeScript
  Future<List<CategoryModel>> getCategories() async {
    try {
      final response = await _tables.listRows(
        databaseId: databaseId,
        tableId: collectionId,
      );

      print('One category document: ${response.rows[1].data}');

      final categories = response.rows
          .map((row) => CategoryModel.fromJson(_rowPayload(row)))
          .toList();

      // Update cache
      for (var category in categories) {
        await CacheService.cacheCategory(category);
      }

      return categories;
    } catch (e) {
      // Fallback to cache if network fails
      try {
        return CacheService.getCachedCategories();
      } catch (_) {
        rethrow;
      }
    }
  }

and this a very basic function calling

and the problem is that on the debug console I am getting this logs

TypeScript
I/flutter (12085): Category list: 25
I/flutter (12085): One category document: {}

It means that I am getting 25 list of documents but I am not getting any data

TL;DR
Developers are not getting data for categories even though they are receiving 25 document lists. The issue might be related to the function `getCategories()` that is not returning the expected data. Debugging log shows that the data is empty. Double-check the function's implementation, especially the `CategoryModel.fromJson(_rowPayload(row))` part.
Raman
31 May, 2026, 01:41

devpolymer is the ID of my project

Raman
31 May, 2026, 01:42

I have checked the permissions as well they are correct

Raman
31 May, 2026, 01:55
TypeScript
I/flutter (12085): One Category list: 25
I/flutter (12085): One Document ID: 6a17215660718b8bffec
I/flutter (12085): One Full Document Map: {$id: 6a17215660718b8bffec, $sequence: 2, $tableId: category, $databaseId: modules, $createdAt: 2026-05-27T16:52:38.990+00:00, $updatedAt: 2026-05-27T16:52:38.990+00:00, $permissions: [read("user:6933ed8f0029d92e799b"), update("user:6933ed8f0029d92e799b"), delete("user:6933ed8f0029d92e799b")], data: {}}

See no data is coming

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