# Manager-Level Group Bonus Logic

**URL:** <https://community.glideapps.com/t/manager-level-group-bonus-logic/84069>\
**Category:** Ask for Help\
**Created:** [August 28, 2025, 2:26pm UTC](https://community.glideapps.com/t/manager-level-group-bonus-logic/84069 "2025-08-28T14:26:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaffleTime](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/raffletime/32/79678_2.png) [@RaffleTime](https://community.glideapps.com/u/RaffleTime)\
**Post date:** [August 28, 2025, 2:26pm UTC](https://community.glideapps.com/t/manager-level-group-bonus-logic/84069/1 "2025-08-28T14:26:30Z")

</div>

Hope you’re doing well!

I’m working on a referral-based app in Glide, and I’ve hit a wall trying to implement something I think you might be able to help with.

### What I’m Trying to Build:

I have a referral tree where:

- Users can refer other users (forming a branching structure).

- Any user can be manually promoted to **Manager** (there are no fixed criteria).

- When someone becomes a Manager, they become eligible for a **Group Sales Bonus (GSB)** — which is **5% of all approved package sales** from users in their **team**.

### Here’s the twist:

A Manager’s **team** should include:

- All users under them in the genealogy,

- **But stop at the next Manager(s)** below them — like a breakaway structure.

Once a new Manager appears down the line, **they start their own team** , and the GSB bonus for the upline Manager ends **before** that.

* * *

### What I Need Help With:

- Figuring out how to **trace a Manager’s team down the referral tree** , stopping when a Manager appears.

- Making sure **each user is linked to the correct Manager** who should receive the GSB for their sales.

- Calculating **5% of approved package sales** from each Manager’s team, and storing it in a separate “GSB Wallet.”

* * *

### What I’ve Tried:

- I already have unilevel logic working (Levels 1–3) using relations and lookups.

- I’m considering tagging each user with their “real” manager (first manager above them), but since Glide doesn’t support recursion, I’m unsure how best to do this.
