Automation Tasks Help

Tom11
Participant I

I could you some assistance with Automation - Tasks to CC a user’s Supervisor when a report is triggered. I have a simple app for completing Juvenile Detention Screens and the app is shared by 9 counties. Each county may have many users, but each county has only one Supervisor. The Supervisors themselves don’t need to have access to the app, just the triggered report. The app has a user table with the following columns: Email, Name, Role, County, Phone Number. Within the Roles column, there are 3 types: Admin, User, and Supervisor. Each Supervisor is listed in the user table, for example:
Email Name Role County Phone Number
somesupervisor@outlook.com, Some Johnson, Supervisor, Stephenson, 555-555-5555
tinasomeone@outlook.com, Tina Turner, User, Stephenson, 555-333-3333

Within Automation - Tasks, when a report is triggered, this is sent to the user who triggered it, i.e. useremail(). Within the Email Content section of the Task, I would like to create an expression that CC’s the triggered report to the users Supervisor, but I’m really struggling to get the expression correct and could use some help.

Thank you in advance for your assistance!

1 6 122
6 REPLIES 6

ANY( SELECT(
  user[email] ,
  AND(
    [role] = "supervisor" ,
    [county] =   LOOKUP( USEREMAIL() , "user" , "email" , "county" )
  )
) )

Tom11
Participant I

Hello and thank you so much, the expression works great! I did write my own, which did seem to work, but may not work as well as yours. What are your thoughts on my version, how might it have failed?

ANY(SELECT(Users[Email],([Role]=“Supervisor”)))

Thanks again!

Yours doesn’t have any comparison against the user’s county. It will just pick the first supervisor in the user table.

Yep, you’re right. It just so happen that when I tested, it should have gone to the first Supervisor listed in the User table. thanks again for all your help!

Hello,

Thanks again for all your help, the expression works great! However, I’ve just run into a new challenge. One of my counties has multiple Supervisors who will need to receive the reports. the expression will currently only choose the first supervisor matching the county. As of now, the only way I can conceive of fixing this (which I doubt is correct) is to give each supervisor a different role, i.e. Supervisor1, Supervisor2, Supervisor3, etc…

I would greatly appreciate your thoughts on this.

Thanks again!

Replace :
ANY(
…with :
TEXT(

Top Labels in this Space