Hi Bubble community,
I’m building a multi-level referral system (up to 3 levels) for my platform.
The idea is:
• When a new user signs up with a referral code, inv1 should be set to the inviter (User type reference).
• Then, inv2 should be automatically set to inv1’s inv1 (i.e., the inviter’s inviter).
• Later, inv3 will be inv2’s inv1.
Current situation:
• inv1 is being recorded correctly at signup.
• However, inv2 is not being recorded.
• I have tried:
• Direct chain expression: Current User’s inv1’s inv1 → fails if any step is empty.
• Using Set State to store ParentUser = Current User’s inv1 and then inv2 = ParentUser’s inv1 → still not working in my case.
• Tried both in front-end workflow and backend API workflow.
Data structure:
• User table:
• referral_code (text, unique)
• inv1 (User)
• inv2 (User)
• inv3 (User)
• referral_code is assigned once after signup.
• Privacy rules allow Current User to modify own inv1, inv2, inv3.
What I want to achieve:
• A reliable way to automatically write inv2 for a new user right after signup (and similarly inv3), even if there’s a delay or the inv1 was just written in the same workflow.
• Preferably a method that avoids empty value issues and works consistently.
Questions for the community:
- Is there a best practice for recording multi-level referral relationships in Bubble?
- Should I always put inv2/inv3 writing in a Backend API workflow with a scheduled delay after signup?
- How can I safely fetch inv1’s inv1 without breaking when there’s an empty value?
Any workflow screenshots or step-by-step examples would be super appreciated!
Thank you in advance