Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / item property based on...
Building Power Apps
Unanswered

item property based on user that's logged in job title

Posted on by 454
Hello,
 
Im trying to have certain items show if the user that's logged Job title contains "Analyst" or Function Lead or Supervisor, or Manager or director or Performance Research.  Those users should be able to see the KB/Training Update" option if it's another job title, then they should not see KB/Training Update.  Do I have this correct or any other recommendations?
 
 
If("Analyst" in Office365Users.MyProfile().JobTitle || "Function Lead" in Office365Users.MyProfile().JobTitle || "Supervisor" in Office365Users.MyProfile().JobTitle || "Manager" in Office365Users.MyProfile().JobTitle || "Director" in Office365Users.MyProfile().JobTitle || "Performance Research" in Office365Users.MyProfile().JobTitle,

If(
    LOBDropDown.Selected.Value="Mobile",["Account/Login Issues","KB/Training Update","Mobile App Issue","Promo/Coupon"],
If(
    LOBDropDown.Selected.Value="myStore",["Account Linking Issues","Account/Login Issues","DCP","Digital Receipt","KB/Training Update","Phone Line","Potential Fraud/Abuse","Promo/Coupon"],

If(
    LOBDropDown.Selected.Value="RxCard",["Account/Login Issues","Gift Card Issue (Begins with 627857105)","KB/Training Update","Phone Line","PSC Issue"],
If(
    LOBDropDown.Selected.Value="Debit/Credit Card",["Account/Login Issues","Credit Card Issue","Debit Card Issue","KB/Training Update"],
If(
    LOBDropDown.Selected.Value="ECom Photo",["Account/Login Issues","Chat","DCP","Issue with Existing Order","KB/Training Update","Phone Line","Photo CSR ID Issues","Potential Fraud/Abuse","Promo","Snapfish JIRA","Website Issue"],
If(
    LOBDropDown.Selected.Value="ECom Retail Product",["Account/Login Issues","Chat","DCP","Email/Salesforce","Gift Card Issue (Begins with 6394257)","Issue with Existing Order","KB/Training Update","Phone Line","Promo/Coupon","Website Issue"],
If(
    LOBDropDown.Selected.Value="ECom General",["Account/Login Issues","Deactivation Request","KB/Training Update","New Hire/Cross-Training Class","Opt-In/Out Issues","Scheduler","VDI"],
    [""]))))))),

If(
    LOBDropDown.Selected.Value="Mobile",["Account/Login Issues","Mobile App Issue","Promo/Coupon"],
If(
    LOBDropDown.Selected.Value="myStore",["Account Linking Issues","Account/Login Issues","DCP","Digital Receipt","Phone Line","Potential Fraud/Abuse","Promo/Coupon"],
If(  
    LOBDropDown.Selected.Value="RxCard",["Account/Login Issues","Gift Card Issue (Begins with 627857105)","KB/Training Update","Phone Line","PSC Issue"],
If(
    LOBDropDown.Selected.Value="myWalgreens Debit/Credit Card",["Account/Login Issues","Credit Card Issue","Debit Card Issue","KB/Training Update"],
If(
    LOBDropDown.Selected.Value="ECom Photo",["Account/Login Issues","Chat","DCP","Issue with Existing Order","KB/Training Update","Phone Line","Photo CSR ID Issues","Potential Fraud/Abuse","Promo","Snapfish JIRA","Website Issue"],
If(
   LOBDropDown.Selected.Value="ECom Retail Product",["Account/Login Issues","Chat","DCP","Email/Salesforce","Gift Card Issue (Begins with 6394257)","Issue with Existing Order","KB/Training Update","Phone Line","Promo/Coupon","Website Issue"],
If(
    LOBDropDown.Selected.Value="ECom General",["Account/Login Issues","Deactivation Request","KB/Training Update","New Hire/Cross-Training Class","Opt-In/Out Issues","Scheduler","VDI"],
    [""]))))))))
 
  • WarrenBelz Profile Picture
    WarrenBelz 141,157 on at
    item property based on user that's logged in job title
    In the second code I posted - I defined _KBTU (Keyboard/Training Update) as being present when the JobTitle is in the list and then included it in the Items lists, so it only displays when the top condition is met.
  • joel914823 Profile Picture
    joel914823 454 on at
    item property based on user that's logged in job title
    Thanks @WarrenBelz - where would the constant variable be added?
  • WarrenBelz Profile Picture
    WarrenBelz 141,157 on at
    item property based on user that's logged in job title
    You can condense this a lot - firstly the quick way
    If(
       Office365Users.MyProfile().JobTitle in ["Analyst", "Function Lead", "Supervisor", "Manager", "Director", "Performance Research"],
       Switch(
          LOBDropDown.Selected.Value,
          "Mobile",
          ["Account/Login Issues","KB/Training Update","Mobile App Issue","Promo/Coupon"],
          "myStore",
          ["Account Linking Issues","Account/Login Issues","DCP","Digital Receipt","KB/Training Update","Phone Line","Potential Fraud/Abuse","Promo/Coupon"],
          "RxCard",
          ["Account/Login Issues","Gift Card Issue (Begins with 627857105)","KB/Training Update","Phone Line","PSC Issue"],
          "Debit/Credit Card",
          ["Account/Login Issues","Credit Card Issue","Debit Card Issue","KB/Training Update"],
          "ECom Photo",
          ["Account/Login Issues","Chat","DCP","Issue with Existing Order","KB/Training Update","Phone Line","Photo CSR ID Issues","Potential Fraud/Abuse","Promo","Snapfish JIRA","Website Issue"],
          "ECom Retail Product",
          ["Account/Login Issues","Chat","DCP","Email/Salesforce","Gift Card Issue (Begins with 6394257)","Issue with Existing Order","KB/Training Update","Phone Line","Promo/Coupon","Website Issue"],
          "ECom General",
          ["Account/Login Issues","Deactivation Request","KB/Training Update","New Hire/Cross-Training Class","Opt-In/Out Issues","Scheduler","VDI"],
          [""]
       ),
       Switch(
          LOBDropDown.Selected.Value,
          "Mobile",
          ["Account/Login Issues","Mobile App Issue","Promo/Coupon"],
          "myStore",
          ["Account Linking Issues","Account/Login Issues","DCP","Digital Receipt","Phone Line","Potential Fraud/Abuse","Promo/Coupon"],
          "RxCard",
          ["Account/Login Issues","Gift Card Issue (Begins with 627857105)","KB/Training Update","Phone Line","PSC Issue"],
          "myWalgreens Debit/Credit Card",
          ["Account/Login Issues","Credit Card Issue","Debit Card Issue","KB/Training Update"],
          "ECom Photo",
          ["Account/Login Issues","Chat","DCP","Issue with Existing Order","KB/Training Update","Phone Line","Photo CSR ID Issues","Potential Fraud/Abuse","Promo","Snapfish JIRA","Website Issue"],
          "ECom Retail Product",
          ["Account/Login Issues","Chat","DCP","Email/Salesforce","Gift Card Issue (Begins with 6394257)","Issue with Existing Order","KB/Training Update","Phone Line","Promo/Coupon","Website Issue"],
          "ECom General",
          ["Account/Login Issues","Deactivation Request","KB/Training Update","New Hire/Cross-Training Class","Opt-In/Out Issues","Scheduler","VDI"],
          [""]
       )
    )
    and then in your case you only have one constant Variable (Keyboard/Training Update), so you can do this
    With(
       {
          _KBTU: 
          If(
             Office365Users.MyProfile().JobTitle in ["Analyst", "Function Lead", "Supervisor", "Manager", "Director", "Performance Research"],
             "KB/Training Update"
          )
       },
       Switch(
          LOBDropDown.Selected.Value,
          "Mobile",
          ["Account/Login Issues",_KBTU,"Mobile App Issue","Promo/Coupon"],
          "myStore",
          ["Account Linking Issues","Account/Login Issues","DCP","Digital Receipt",_KBTU,"Phone Line","Potential Fraud/Abuse","Promo/Coupon"],
          "RxCard",
          ["Account/Login Issues","Gift Card Issue (Begins with 627857105)",_KBTU,"Phone Line","PSC Issue"],
          "Debit/Credit Card",
          ["Account/Login Issues","Credit Card Issue","Debit Card Issue",_KBTU],
          "ECom Photo",
          ["Account/Login Issues","Chat","DCP","Issue with Existing Order",_KBTU,"Phone Line","Photo CSR ID Issues","Potential Fraud/Abuse","Promo","Snapfish JIRA","Website Issue"],
          "ECom Retail Product",
          ["Account/Login Issues","Chat","DCP","Email/Salesforce","Gift Card Issue (Begins with 6394257)","Issue with Existing Order",_KBTU,"Phone Line","Promo/Coupon","Website Issue"],
          "ECom General",
          ["Account/Login Issues","Deactivation Request",_KBTU,"New Hire/Cross-Training Class","Opt-In/Out Issues","Scheduler","VDI"]
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • jefmeyer Profile Picture
    jefmeyer 150 on at
    item property based on user that's logged in job title
    I would recommend creating a context variable for the MyProfile, so you aren't doing multiple lookups to improve performance.  The IF logic works, but a Switch may be easier to read.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,157

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,414

Leaderboard