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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Auto populate a manage...
Power Apps
Answered

Auto populate a managers Name field based on more than one condition

(0) ShareShare
ReportReport
Posted on by 90

So I have a form that I have created and needs to get an approval  before it continues.
the approval route has two options

1. the regional manager only needs to approve (in  these cases there is no team manager) the user reports directly to the regional manager

2. The team manager and the regional manager both need to approve.

 

I have added two person fields that auto populate based on the user

Field 1 Is team manager

field 2 is Regional manager

have used the following two formulae to achieve this.

for the team manager (based on the user)

TJCappy_0-1700180853213.png

 

for the regional manager (based on the manager)

TJCappy_1-1700180897771.png

 

what I now would like to do is, 
if the title of the person listed in the regional manager field is anything other than "Regional Manager"  then the field will remail blank.

Would anyone be able to assist me with this?

 

Many thanks

 

 

 

 

 

 

Categories:
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @TJCappy ,

     

    Next time, please remember to post the formula in text form so that we can quickly modify it instead of just typing it by hand.

     

    Please try below formula and see if it works for you:

    If(
     Office365Users.ManagerV2(DataCardValue1.Selected.Email).JobTitle = "Reginal Manager",
     {
     Claims:"i:0#.f|membership|" & Office365Users.ManagerV2(DataCardValue1.Selected.Email).mail,
     Email:Office365Users.ManagerV2(DataCardValue1.Selected.Email).mail,
     DisplayName:Office365Users.ManagerV2(DataCardValue1.Selected.Email).displayName,
     Department:"",
     JobTitle:"",
     Picture:""
     },
     Blank()
    )

     

    Best regards,

  • TJCappy Profile Picture
    90 on at

    Hi @v-jefferni 

     

    Unfortunately this formula does not work.  I also believe that I did not explain what I need correctly so here goes a, hopefully better description of what I need"

     

    In DataCardValue1 the Manager of the user auto-populates. In most cases this will be their team manager but in some instances, where there is no Team Manager, the name that auto populates will be that of the user’s regional manager. – This is a straight forward situation that uses the formula


    { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims: "i:0#.f|membership|" & Office365Users.ManagerV2(User().Email).mail, Department: "",
    DisplayName: Office365Users.ManagerV2(User().Email).displayName,
    Email: Office365Users.ManagerV2(User().Email).mail, JobTitle: "", Picture: "" }

     

    Based on the name displayed in DataCardValue1, using the formula below, DataCardValue2 now shows the name of the manager of the person listed in DataCardValue1.


    { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims: "i:0#.f|membership|" & Office365Users.ManagerV2(DataCardValue1.Selected.Email).mail, Department: "", DisplayName: Office365Users.ManagerV2(DataCardValue1.Selected.Email).displayName, Email: Office365Users.ManagerV2(DataCardValue1.Selected.Email).mail, JobTitle: "", Picture: "" }


    This all seems pretty normal and easy, the issue arises when the user’s Manager is actually the Regional Manager, because then the name listed in DataCardValue2 is that of the Vice President.

     

    What I wish to achieve is that if the title of the person listed in DataCardValue2 is not Regional Manager then the result will be a blank DataCardValue2.


    Alternatively we could say,

    if the title of the person listed in DataCardValue1 is Regional Manager then DataCardValue1 should be blank.

     

    Thanks for your assistance

  • TJCappy Profile Picture
    90 on at

    Hi @v-jefferni 

    please ignore the previous response I realised that I our Title column had a spelling error in the title that was causing the formula to fail.

     

    Thanks again for your help.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard