How would you do this?

Now I know there are some geniuses out there :slight_smile:
What I want to do on a membership portal is assign a number to a group of members when they register. I need this number to goto the next number after x amount of people are registered under one number:

Example
Member 1 - Group 1
Member 2 - Group 1
Member 3 - Group 1
Member 4 - Group 1
Member 5 - Group 1

Member 6 - Group 2
Member 7 - Group 2
Member 8 - Group 2

etc

Do any of you geniuses have an ideas how to implement this?

save latest amount of people in table then when new user register and registration success assign the group. you can use condition

WORKED IT OUT PLEASE IGNORE

So now I am running into issues.
I have a:
Database Query - Working no issues
Set Value - last count {{query1.last(1)}}

The set value returns:
“lastcount”: [
{
“Name”: “6”,
“group”: 2
}
],
Now I need to filter another database to get the amount of records with that ID (in this example ‘2’)
Problem I am having is if I filter it using (lastcount.group) it does not return any records.

Am I missing something here or should this work ??

For your exact example above it would be

lastcount[0].group

When the json contains an array (signifies by the then you need to specify the index pointing to which element in that array you want… in this case the first result which is found with zero.