Branch on condition - boolean expression - unexplained inconsistency

In a bot with "Branch on condition" expression the following works

COUNT(LIST(INDEX(TOP(ORDERBY(FILTER("Waitlist", AND(
[Site ID] = [_THISROW].[Site ID],
[_THISROW].[Parking Date] = [Parking Date],
[Status] = "WAITLIST")),
[Request Date], FALSE
), 1),1).[Booking ID])) > 0

but a simpler form of the same expression doesn't work as expected. The objective is to check if we have any entries in the waitlist. 

ISNOTBLANK(FILTER("Waitlist", 
AND(
[_THISROW].[Parking Date] = [Parking Date],
[Site ID] = [_THISROW].[Site ID],
[Status] = "WAITLIST")
)
)

 

Solved Solved
0 4 167
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

AppSheet does not support this construct:

Steve_0-1670428677787.png

You cannot dereference an intermediate value; you can only dereference a column value directly.

Dereference expressions - AppSheet Help

Here is you first expression, reformatted for my clarity:

COUNT(
  LIST(
    INDEX(
      TOP(
        ORDERBY(
          FILTER(
            "Waitlist",
            AND(
              [Site ID] = [_THISROW].[Site ID],
              [_THISROW].[Parking Date] = [Parking Date],
              [Status] = "WAITLIST"
            )
          ),
          [Request Date],
            FALSE
        ),
        1
      ),
      1
    ).[Booking ID]
  )
)
> 0

LIST(INDEX(TOP(..., 1), 1) is exactly equivalent to TOP(..., 1).

View solution in original post

4 REPLIES 4

Will this altered expression bring a difference?

Count(FILTER("Waitlist", 
AND(
[_THISROW].[Parking Date] = [Parking Date],
[Site ID] = [_THISROW].[Site ID],
[Status] = "WAITLIST")
)
)>0 

 

Thanks @Koichi_Tsuji I tried this one as well  and it didn't work. 

Sorry for little help.

I suggest you debug your expression by inserting it into VC for the table of "Waitlist" and check if each row returns the result what you expect.

 

Steve
Platinum 4
Platinum 4

AppSheet does not support this construct:

Steve_0-1670428677787.png

You cannot dereference an intermediate value; you can only dereference a column value directly.

Dereference expressions - AppSheet Help

Here is you first expression, reformatted for my clarity:

COUNT(
  LIST(
    INDEX(
      TOP(
        ORDERBY(
          FILTER(
            "Waitlist",
            AND(
              [Site ID] = [_THISROW].[Site ID],
              [_THISROW].[Parking Date] = [Parking Date],
              [Status] = "WAITLIST"
            )
          ),
          [Request Date],
            FALSE
        ),
        1
      ),
      1
    ).[Booking ID]
  )
)
> 0

LIST(INDEX(TOP(..., 1), 1) is exactly equivalent to TOP(..., 1).

Top Labels in this Space