cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

People picker field - Check if job title contains specific value

Hi guys,

 

I would need your help as I am running out of ideas. Please check following description of issue.

 

Issue: I am creating app where user can select back-up approver of ticket in the people picker field. The expectation is that app will check the job title of the person and change the fill of the field as per below:

 

If blank = Transparent

If job title contains "Team Lead" or "Manager" or "Director" = Green

Otherwise change fill color to Red

 

I have tried to create simple condition as per below however I am getting error: Expected text - we expect text at this point in the formula. This error occurs if you use a function that requires a text (or string) argument and you supply, for example, a date instead.

 

If("Lead" in DataCardValue36, RGBA(0, 255, 0, 1), RGBA(255, 255, 255, 1))

 

Any help is much appreciated!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Hi @jsarlii ,

 

Could you tell me:

  • What property of the control do you want to change the color?
  • What’s the Items property of DataCardValue36?
  • What property is your formula used for?

 

I assume:

  • DataCardValue36 is a combo box control.
  • DataCardValue36’s Items property is: Table(Office365Users.MyProfile())
  • My test JobTitle is “Leader”.

v-xiaochen-msft_0-1610426587170.png

 

 

 

I use the color property of the label control to demonstrate:

1\ Set the color property of the label control to:

If("Lead" in DataCardValue36.Selected.JobTitle, RGBA(0, 255, 0, 1), RGBA(255, 255, 255, 1))

 

2\ The result is as follows:

v-xiaochen-msft_1-1610426587171.png

 

v-xiaochen-msft_2-1610426587174.png

 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

2 REPLIES 2
Microsoft
Microsoft

Hi @jsarlii ,

 

Could you tell me:

  • What property of the control do you want to change the color?
  • What’s the Items property of DataCardValue36?
  • What property is your formula used for?

 

I assume:

  • DataCardValue36 is a combo box control.
  • DataCardValue36’s Items property is: Table(Office365Users.MyProfile())
  • My test JobTitle is “Leader”.

v-xiaochen-msft_0-1610426587170.png

 

 

 

I use the color property of the label control to demonstrate:

1\ Set the color property of the label control to:

If("Lead" in DataCardValue36.Selected.JobTitle, RGBA(0, 255, 0, 1), RGBA(255, 255, 255, 1))

 

2\ The result is as follows:

v-xiaochen-msft_1-1610426587171.png

 

v-xiaochen-msft_2-1610426587174.png

 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Hello,

 

thank you a lot for the solution - this is very helpful! DataCardValue36 is people picker field without any further formatting.

 

I have managed to create complex formula as per below.

 

If("Lead" in DataCardValue36.Selected.JobTitle, RGBA(255, 255, 255, 1), If("Manager" in DataCardValue36.Selected.JobTitle, RGBA(255, 255, 255, 1), If("Director" in DataCardValue36.Selected.JobTitle, RGBA(255, 255, 255, 1), If(IsBlank(DataCardValue36.Selected.JobTitle), RGBA(255, 255, 255, 1), RGBA(255, 0, 0, 1)))))

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (73,768)