Bot count returns 1 when checklist view is empty — possible LIST("") vs LIST() issue?

Hi everyone, I’m trying to debug what looks like inconsistent list/count behaviour in AppSheet.

I have documents that can be acknowledged by many tenants for a specific property.

For the logged-in tenant, the checklist view behaves correctly. When there is nothing left to acknowledge, the checklist is blank.

I also have a second view that shows acknowledged documents.

The problem is with a weekly bot that sends reminder emails for outstanding acknowledgments. The bot keeps firing even when the tenant-facing checklist is empty, because COUNT(CheckListDocs[_RowNumber]) is evaluating to 1 instead of 0.

One of the tests I’ve tried is comparing the two lists in a virtual column:

COUNT(CheckListDocs[_RowNumber]) - COUNT(AcknowledgedDocuments[_RowNumber])

This works inconsistently. Sometimes it appears correct while testing, but after saving, refreshing, or switching users, the result changes and becomes incorrect again.

I’m wondering whether this could be related to how AppSheet handles empty versus blank list values, for example:

COUNT(LIST()) = 0
COUNT(LIST("")) = 1

So I’m questioning whether the bot, slice, or VC is ending up with a list containing a blank value rather than a truly empty list.

Has anyone seen this kind of behaviour before, where:

  • the checklist is correct

  • but the bot still thinks one record remains

  • (bot runs with security bypass security filters and for Each Row In Table)

  • and VC/list comparisons seem to evaluate inconsistently depending on refresh/save/user context?

I’d be especially interested in whether this could be related to user context, security filters, bots evaluating outside the interactive user session, or list expressions returning a blank item instead of an empty list. :thinking:

Hello @Harriswe,

Welcome back to the Appsheet community! I certainly hope to see you here more often.

I found this help article on how count function works. My recommendation would be to add something like:

IF(ISNOTBLANK([LIST]),‘it is not empty’, ‘list is empty’)

I hope this helps!

LIST() is a list with 0 items. LIST("") is a list with 1 item: an empty Text value.

I suggest capturing CheckListDocs[_RowNumber] in a separate virtual column to see what it is.

[_RowNumber] can/will never be blank. CheckListDocs[_RowNumber] can be empty, but will never have any empty values.

Hi @Jose_Arteaga,

That was my first thought as well, but it did not work.

In the app, the Checklist view is empty, and it is based on the CheckListDocs slice. However, when I check the CheckListDocs slice in a bot or template, it still behaves as though there is at least one document in it, even though the view shows none. Hence I started to use COUNT() :face_with_monocle:

Hi @Steve

Tried what you suggested…

and it showed the following:

I also put a COUNT vc and it shows 1 too. :face_with_monocle:

Hi @Harriswe

If you want to use List or Ref types, it is better to use a physical table column rather than a virtual column.

​This is because the data you select needs to be recorded and stored permanently. Features like EnumList only appear correctly in Forms or Quick Edit (Detail View) when they are part of an actual table column.

Virtual columns generally cannot store user input. Therefore, you should add a new column to your spreadsheet or database to save the values selected from your List or Ref."

Please post a screenshot of the columns of the CheckListDocuments table that shows at least the _RowNumber, key, and label columns.