Count Users with specific status

Greetings all:

Looking for guidance on how to count the number of Users with an “active” status (a field already in the table); then when a certain amount (e.g. 100) is reached an error is displayed on a registration page through a validation rule.

I’m sure this is a simplistic task however I have stumbled on the solution.

Any help would be greatly appreciated!

~Adam

Here’s how to count active users, Add a table Called Licenses, then add this table to the users table as a connection and then add a Sum field to the License table with a condition. As far as a validation, you’ll have to play with that and see if you can do it.



1 Like

@SuiteUpstairs Great solution, but won’t work with validation.

With Pipes you’ll solve this easily.

You’ll be able to create a custom API Call and check total active users than show an error when its over the specified limit.

As soon as it’s live I’ll report back here with exact instructions. Wouldn’t take more than 3 minutes to get it set up.

1 Like

Thanks Moe for the update…really looking forward to Pipes functionality. It should clear up many of my “stalled” functionality issues at the present moment.

Cheers!
~Adam

Hey Adam, we are working on comprehensive docs, but if you wanted a quick way of achieving this- here it is. I won’t bother explaining things in detail, rather give you rough instructions.

For more details check out the support docs (still being written, but slowly being rolled out).

  1. Add a new Pipe then add 3 new Global Parameters:

To make this process easier, paste in the API values from the API settings of your app into the default value column.

Next, add a new API Call, name it and add the following 3 headers:

Key: X-Tadabase-App-id
Value: {appId} (or whatever Slug you define in previous step)

Key: X-Tadabase-App-Key
Value: {apiKey} (or whatever Slug you define in previous step)

Key: X-Tadabase-App-Secret
Value: {appSecret} (or whatever Slug you define in previous step)

Next add the following to the URL/Method:
Method = GET
URL = https://api.tadabase.io/api/v1/data-tables/4MXQJdrZ6v/records?filters[items][0][field_id]=status&filters[items][0][operator]=is&filters[items][0][val]=Active

And the last step is to define the response.
In the response tab set the following:

Code: 200
Key: JSON total_items
Field Name: Total Active Users
Data Type: Number

Now that this Pipe is configured, you can do a test in the tests tab.

Next in your signup component add the following validation rule:

Very rough instructions just wanted to show you in case you wanted to give this a shot.

1 Like

@moe this looks like a challenge…accepted. I will give it a shot and see if I can make it work. Thanks for the details!

All the best my friend,
~Adam

Moved this discussion over to the Pipes category.

1 Like

Moe-

I installed the Count Active Users pipe and it works flawlessly! Thank you so much…

For others that will use this please note that in the URL that Moe posted above there is a key piece you will have to change:

Look in the URL string and you will see 4MXQJdrZ6v; this will need to be changed to application’s Users Table id from the Tadabase Builder area.

Again, many thanks Moe!

~Adam

1 Like