<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00008Qkp2kSABOkta Classic EngineUniversal DirectoryAnswered2024-04-15T09:21:43.000Z2020-05-04T18:57:18.000Z2020-05-05T17:47:51.000Z

ulazx (ulazx) asked a question.

Group expression for pulling in users by manager and user type

I am trying to populate groups based on managers. i have this so far

user.userType=="Employee" AND String.stringContains(user.ManagerUPN,"manager1@mydomain.com") OR String.stringContains(user.ManagerUPN,"manager2@mydomain.com") OR String.stringContains(user.ManagerUPN,"manager3@mydomain.com")

 

IT seems to work if its just the strings but when I want to be more granular by only pulling in the users whose User Type is Employee is doesnt want to work as it still will add Contingent Workers to the group. Seems I am missing something very simple.

 


  • User15851122134349081871 (North Central-Enterprise)

    Could this just be the grouping of the logical functions? For example:

     

    String.stringContains(user.ManagerUPN,"manager1@mydomain.com") OR String.stringContains(user.ManagerUPN,"manager2@mydomain.com") OR String.stringContains(user.ManagerUPN,"manager3@mydomain.com")

     

    will return any string that contains any of those matches. But this:

     

    user.userType=="Employee" AND String.stringContains(user.ManagerUPN,"manager1@mydomain.com") OR String.stringContains(user.ManagerUPN,"manager2@mydomain.com") OR String.stringContains(user.ManagerUPN,"manager3@mydomain.com")

     

    will return any string that has an Employee user type and matches manager 1, or anyone that matches manager 2, or anyone that matches manager 3. Is the logical grouping you're looking for this?

     

    user.userType=="Employee" AND (String.stringContains(user.ManagerUPN,"manager1@mydomain.com") OR String.stringContains(user.ManagerUPN,"manager2@mydomain.com") OR String.stringContains(user.ManagerUPN,"manager3@mydomain.com"))

    Expand Post
  • ulazx (ulazx)

    Tim,

    By the grouping itself pulls all the users who are reports to the managers but when i add the user.userType="Employee" it doesn't filter out users that have the usertype of Employee only, it still pulls in Contingent Worker types

  • User15851122134349081871 (North Central-Enterprise)

    But did you see my different grouping of the logic, above? Does this not change the results?

  • ulazx (ulazx)

    The middle grouping and last grouping are the same except for the extra parenthesis at the end... I must not be seeing this correctly 🙂

  • User15851122134349081871 (North Central-Enterprise)

    The last expression has an opening parenthesis after the AND. Essentially you want to OR all the possible manager string matches, and then AND the result with the user type, right? Try copy-pasting it to see the difference.

This question is closed.
Loading
Group expression for pulling in users by manager and user type