cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cma2438
Level: Powered On

PowerApps IF Statement identify Job Title

Hello I am working on a powerapp and wanting it to put in a data card "approved" or "pending" if the job title is "Like" something.

 

So i am starting with the high level and working my way down by positions i want to have Approved. 

 

The formulas dont error out but when I test the app the Data card doesnt show either so i think there is something wrong with the formula. 

 

I tried the following..

If(Office365Users.MyProfile().JobTitle = "Director","Approved","Pending")

    I know this wouldnt work because no position is just "Director" 

If(Office365Users.MyProfile().JobTitle in "Director","Approved","Pending")

If(Office365Users.MyProfile().JobTitle like"Director","Approved","Pending")

 

Any help would be greatly appreciated!

2 ACCEPTED SOLUTIONS

Accepted Solutions
tchin-nin
Level 10

Re: PowerApps IF Statement identify Job Title

Hi @cma2438

 

If you JobTitle contains Director (or like '*Director*' in sql) you can try:

If("Director" in Office365Users.MyProfile().JobTitle,"Approved","Pending") (note: in operator is case-insensitive)

 

You may have in your app to test several time the user JobTitle, I would suggest you to define a variable ("OnVisible" property of your screen for example) : 

Set(currentUserProfile, Office365Users.MyProfile())

So you don't have to call the Office365Users connector every time, you can just refer to currentUserProfile.JobTitle to test the value.

 

Théo

View solution in original post

Community Support Team
Community Support Team

Re: PowerApps IF Statement identify Job Title

Hi @cma2438,

 

Could you please share a bit more about your scenario?

Do you want to populate "Approved" or "Pending" within a Data card within your Edit form based on the Job Title?

 

I agree with @tchin-nin's thought almsot. I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

 

 

Set the Default property of the Data card control to following formula:

If("Director" in Office365Users.MyProfile().JobTitle,"Approved","Pending")

More details about the in operator (case-insensitive) in PowerApps, please check the following article:

In operator

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
tchin-nin
Level 10

Re: PowerApps IF Statement identify Job Title

Hi @cma2438

 

If you JobTitle contains Director (or like '*Director*' in sql) you can try:

If("Director" in Office365Users.MyProfile().JobTitle,"Approved","Pending") (note: in operator is case-insensitive)

 

You may have in your app to test several time the user JobTitle, I would suggest you to define a variable ("OnVisible" property of your screen for example) : 

Set(currentUserProfile, Office365Users.MyProfile())

So you don't have to call the Office365Users connector every time, you can just refer to currentUserProfile.JobTitle to test the value.

 

Théo

View solution in original post

Community Support Team
Community Support Team

Re: PowerApps IF Statement identify Job Title

Hi @cma2438,

 

Could you please share a bit more about your scenario?

Do you want to populate "Approved" or "Pending" within a Data card within your Edit form based on the Job Title?

 

I agree with @tchin-nin's thought almsot. I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

 

 

Set the Default property of the Data card control to following formula:

If("Director" in Office365Users.MyProfile().JobTitle,"Approved","Pending")

More details about the in operator (case-insensitive) in PowerApps, please check the following article:

In operator

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

cma2438
Level: Powered On

Re: PowerApps IF Statement identify Job Title

Yes that words im tyring to get the data card to auto populate a pending or Approved "Status" so if the user is pending my flow will submit a approval flow for the manager. But it actually started working when i changed Approved to "1" and Pending to "2"

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,132)