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

Community site session details

Session Id : SazncAr4F1X5Algp9AdLCG
Power Apps - Building Power Apps
Answered

Need to hide a field base on JobTitle

Like (0) ShareShare
ReportReport
Posted on 29 Apr 2024 18:46:04 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 29 Apr 2024 at 20:27:00
    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 Moderator on 29 Apr 2024 at 20:04:25
    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 29 Apr 2024 at 19:44:26
    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 29 Apr 2024 at 19:42:54
    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 29 Apr 2024 at 19:37:14
    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 Moderator on 29 Apr 2024 at 19:21:09
    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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete