Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Need to hide a field base on JobTitle

(0) ShareShare
ReportReport
Posted on by

I have a "RequestorJobTitle" text field that looks up the current user's Job Title using this formula:

First(Office365Users.SearchUser({searchTerm:txtRequestor.Selected.Email}).JobTitle)
 
This shows the users job title. Now I want to hide another field any time "RequestorJobTitle" contains the word "Manager", "Director", "Vice" or "Chief"
 
I've tried this:
If("Manager" in Office365Users.MyProfile().JobTitle, false, true Or If("Director" in Office365Users.MyProfile().JobTitle, false, true) Or If("Vice" in Office365Users.MyProfile().JobTitle, false, true) Or If("Chief" in Office365Users.MyProfile().JobTitle, false, true))
 
and:
 
If(Switch("Manager" in Office365Users.MyProfile().JobTitle, "Director" in Office365Users.MyProfile().JobTitle, "Vice" in Office365Users.MyProfile().JobTitle, "Chief" in Office365Users.MyProfile().JobTitle), false, true)
 
Which doesn't seem to work. What is the best way to do this?
  • Verified answer
    Jambou Profile Picture
    on at
    Re: Need to hide a field base on JobTitle

    Thank you @Gochix.  This works perfectly!  Thank you so much.

  • Verified answer
    Gochix Profile Picture
    1,933 Super User 2025 Season 1 on at
    Re: Need to hide a field base on JobTitle

    @Jambou ,

     

    use: 

    If(
     Or(
     !IsBlank(Find("Manager", RequestorJobTitle.Text)),
     !IsBlank(Find("Director", RequestorJobTitle.Text)),
     !IsBlank(Find("Vice", RequestorJobTitle.Text)),
     !IsBlank(Find("Chief", RequestorJobTitle.Text))
     ),false,true)


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • Jambou Profile Picture
    on at
    Re: Need to hide a field base on JobTitle

    Thank you @Amik ,

     

    I tried adding this to the Visible property and it's doesn't work.

    !Office365Users.MyProfile().JobTitle in [
        "Manager",
        "Director",
        "Vice",
        "Chief"
    ]
  • Jambou Profile Picture
    on at
    Re: Need to hide a field base on JobTitle

    Hi @Gochix ,

    I tried this and it works for "Manager" but how can I get it to work with the other values "Director", "Vice" and "Chief"?

     

    I tried this and it does't work:
    If(!IsBlank(Find("Manager",txtRequestorJobTitle.Text)),false,true Or !IsBlank(Find("Director",txtRequestorJobTitle.Text)),false,true Or !IsBlank(Find("Vice",txtRequestorJobTitle.Text)),false,true Or !IsBlank(Find("Chief",txtRequestorJobTitle.Text)),false,true)

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on at
    Re: Need to hide a field base on JobTitle

    @Jambou - in addition to the solution from @Gochix, apply the below to the Visible property:

     

    !Office365Users.MyProfile().JobTitle in [
     "Manager",
     "Director"
     "Vice",
     "Chief"
    ]

     

    Note the absence of the IF function. Given the Visible property only accepts a Boolean (true/false), there is no need to wrap an IF function around a formula which is already going to return a Boolean anyway.

  • Gochix Profile Picture
    1,933 Super User 2025 Season 1 on at
    Re: Need to hide a field base on JobTitle

    @Jambou ,

     

    As you are mentioning that you want to hide another field if the RequestorJobTitle.Text contains specific word, then you don't have to filter through the Office365Users again, but rather the JobRequestorJobTitle.Text.

    If(!IsBlank(Find("Manager",RequestorJobTitle.Text)),false,true)


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,596 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard