web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / item property based on...
Power Apps
Answered

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

(2) ShareShare
ReportReport
Posted on by 557
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"],
    [""]))))))))
 
Categories:
I have the same question (0)
  • jefmeyer Profile Picture
    166 on at
    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.
  • Verified answer
    WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    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

     
  • joel914823 Profile Picture
    557 on at
    Thanks @WarrenBelz - where would the constant variable be added?
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    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
    557 on at
    Hi @warrenbelz my apologies.  Am I using both of these formulas in the items property of the datacardvalue?  I'm a little unsure where each of these two formulas would go?
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    Wherever you are using the code you posted - I simply condensed it offering two versions. I also free-typed the code more as a guide to the structure and assumed due the complexity you used in the posted code that you had the ability to interpret this.
  • joel914823 Profile Picture
    557 on at
     @WarrenBelz - thank you for clarifying.  I tried both but someone with job title "Technician" was still able to see KB/Training Update option.  :(  Any other thoughts how I could achieve this?

    I also tried to do a hidden text field (that equals the user's job title and replaced that in the formula, but that didn't work either :(
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    Hi
    How can they see that - Technician is not in the list. You could make it a bit more specific, but I think it would produce a blank line
    With(
       {
          _KBTU: 
          If(
             Office365Users.MyProfile().JobTitle in ["Analyst", "Function Lead", "Supervisor", "Manager", "Director", "Performance Research"],
             "KB/Training Update",
             ""
          )
       },
     
  • joel914823 Profile Picture
    557 on at
    @warrenbelz you are correct it creates a blank line...

    Also tried to put the job title in a text input...see below - job title is Analyst.  For this example I simplified so only if it contains supervisor, and still the option for kb training comes up..
  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at
    OK some debugging required here - put this on a label
    Office365Users.MyProfile().JobTitle in ["Analyst", "Function Lead", "Supervisor", "Manager", "Director", "Performance Research"]
    which will return true or false. Are you testng this with different users ?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard