I need to change emails in a formula as the person in a user role changes

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
This sounds odd, but bear with me.

Our team rotates out team leads every 6 months, to build experience and training.  So I am creating a user role that I can just reassign to the new team lead so that the team lead workflow and history is carried by the role not the user.

To that extent, I want to create email notifications that trigger off when a team member finishes a milestone in the project.  The problem is I don't want to have to hard code an email address, instead I want to hard code the team lead.  The problem I have is I don't see how to select a user's role, and therefore the email associated with the team lead.

Hopefully that makes sense.  Anyway any thoughts?
Photo of Neil Shepard

Neil Shepard

  • 1,248 Points 1k badge 2x thumb
  • what's not to like?

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,486 Points 50k badge 2x thumb
Formulas cannot see Roles.  You will need to have a record somewhere to record the Current Team userid and look that up down to the task records.
Photo of Drew

Drew

  • 432 Points 250 badge 2x thumb
There are a couple of ways to do this that are pretty straightforward.  I create my own 'user' table in every app that i build which can be used for a myriad of things.  However, if you want to just track this one 'user' role, create a table called 'settings'  (or whatever you want).  Add a user field called 'current team leader'.  Create one record, and one record only for this table.  

The record ID, if you only create one record, should be '1'.  Create a relationship to this table from your tasks or milestones table.  For the value 'related setting', set the default value to '1'.  

From this point on, whenever you change the 'team leader' user in the 'settings' table, it will be reflected in all the other tables that you relate to 'settings'.  You then set the email notifications to the email address of the 'related setting - team leader'.   
Photo of Neil Shepard

Neil Shepard

  • 1,248 Points 1k badge 2x thumb
Thanks Coach and Drew!