I have a conditional using a Search for, but :count returns an unexpected value that doesn’t match with what the debugger shows is found by the Search for. Weirdly enough, it returns the correct value after a page refresh.
As you can see in the second screenshot, the Search for doesn’t find anything (it says right there, (empty), yet the count is 1.
That is quite odd. I have seen some unpredictable results with the Bubble db at peak hours. That it works after a page refresh is notable but doesn’t fully explain it either…
Does the issue persist today? If so, I would suggest contacting bubble support. If you can, go into the logs and send them the workflow id of one this is happening for to assist them in tracking it down.
Ahh, your constraint also contains lesson id = xxxxxx You should only have constraints for user and completed?
I’m on mobile and can’t check a debugger but it looks like you are evaluating if the search’s count is 1. If you are then it should return 0 since the search does return a count of 0 and hence the result of your expression is 0.
I need lesson_id too because I’m using this Search for inside a Repeating Group of lessons that each have their own completed? set to yes or no.
You’re right that the Search For doesn’t return any rows in this case, but if you take a look at the screenshot in which I highlight the :count, it says that the count is 1, even if the Search for doesn’t return any rows
No it does not. The correct value is returned only after a refresh or after pressing the button that changes the completed? to no a second time. But weirdly enough completed? has the correct value in the database with only 1 press of a button. The second press/page refresh fixes the return value of the Search for:count.
Hi @tudor.cezar01 , did you find a solution to your issue? I’m having the same problem, unexpected count, while everything seems to be right, and what confirms me it is that when I refresh the number gets right.