Custom action is not counting correctly

When I try to pass a count value in a custom action, if the count has filters on it, it returns 0/null.

If I set it to count all users, it counts correctly.

But if I count all users with permission X , it returns 0/null .

Has anyone else run into this?

Hi @nadavma2,

In my experience, this is not related to just custom actions; counts aren’t very stable in general. I have some ideas why this might happen, but this can’t be fixed from maker’s side.

Two workarounds which I use sometimes:

  • If this screen also has a list of same items (filtered), counts for same items/filters usually work better;
  • I add the helper property to Users collection, and store the value for this filtered count there.

Best regards, Victor.

2 Likes

@Dilon Do you know the problem?

Hi @nadavma2,

What would be the filters? Includes m2m relations? I think the custom action fires up before Adalo process the count with filters and if I remember correctly, there were few cards in the board regarding issues with counts, I’ll note this one! I normally go with the second point which Victor mentioned, or pull-out the value using an input default value.

Thank you and have a great day!

All kinds of filters

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.