[SOLVED] How to automatically assign a Member into a Role right after Approving the Site Member Request?

I have had a lot of example codings for a REAL-CUSTOM-LOGIN-SYSTEM…
Try to find some of my posts in the SEARCH-BAR of this FORUM…

Here is one example… (but you will find much more infos when you find all the other posts, about my custom Login-System…

Thank you for the assistance @russian-dima !
I already read your post and it was one of my references when I was creating an auto-approve Site Member request (I set the site to Manually Approve) followed by an auto assign of Site Member Role. Your post helped me a lot!

On this particular post, my concern is how to trigger a code whenever a site admin approves a member request:

And then, auto assign the member into a Role - depending on what Form they filled out.

My initial solution for the auto assign the member into a Role is to query Submission Form Collection and check if their email is recorded there.

But my main problem is how to trigger a code whenever a site admin approves a member request.

https://www.wix.com/velo/reference/wix-members-backend/authentication/approvebytoken

well I’d use onMemberCreated and assignRole.
Have a look at

wow! this is very useful! thank you so much @doug-antill !!