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 / Autofill SP columns fr...
Power Apps
Answered

Autofill SP columns from Powerapp

(0) ShareShare
ReportReport
Posted on by 338

Im little bit lost and trying to fight my way to accomplish the following. I have two SP fields added as Person or Group: 1. Employee Name and Employee manager. Im trying to figure is there a way to populate the employee manger based on the Employee name with format of the columns. I know it can be done if the columns are text ones but I need those to be searchable in our company AD to ease the use of the app. Thank you in advance for the help

Categories:
I have the same question (0)
  • Abhilash_Swain Profile Picture
    901 on at

    Hi @SectorOMEGA ,

    If it is a text field:-  use Office365Users.Manager(User().Email).DisplayName [to use this add Office365users as a data connector]

     

    It will show the current user's Manager.

    Please give a thumbs up or accept it as a solution if I answered your query.

    Thanks

    Abhi

  • SectorOMEGA Profile Picture
    338 on at

    Both  fields are created in SP as Person or Group in order to be able to search the company AD. Th current user is not useful in my case. Employee name will be filled by the user and should be different.

  • Verified answer
    sayyedkohler Profile Picture
    313 on at

    Hi @SectorOMEGA 
    I tested with your requirement.
    If you are trying to get manager in PowerApps form then this is the correct solution:

    Step1: Insert Form in PowerApps
    Step2: Unlock Manager fields.

    sayyedkohler_0-1628001478085.png


    Step3:  Set Manager Combo Box DefaultSelectedItems property with this code: 
    Note:
     Replace DataCardValue6 with your Employee Combo Box Name.

    {Claims:"i:0#.f|membership|"& Office365Users.Manager(First(DataCardValue6.SelectedItems).Email).Mail,
    Email:Office365Users.Manager(First(DataCardValue6.SelectedItems).Email).Mail,
    Department:"",
    DisplayName:Office365Users.Manager(First(DataCardValue6.SelectedItems).Email).DisplayName,
    JobTitle:"",
    Picture:""

     
    Thanks

  • SectorOMEGA Profile Picture
    338 on at

    @sayyedkohler That did it. However is there a way to ignore the error that it gives me when the employee name is empty?

  • sayyedkohler Profile Picture
    313 on at

    You can set condition on DefaultSelectedItems property of Manager:
    If( !IsBlank(EmployeeField.SelectedItems), 'Paste your default code here')

  • SectorOMEGA Profile Picture
    338 on at

    @sayyedkohler If I put it like this:

    If(!IsBlank('Employee email'.SelectedItems), {Claims:"i:0#.f|membership|"& Office365Users.Manager(First(DataCardValue4.SelectedItems).Email).Mail,
    Email:Office365Users.Manager(First(DataCardValue4.SelectedItems).Email).Mail,
    Department:"",
    DisplayName:Office365Users.Manager(First(DataCardValue4.SelectedItems).Email).DisplayName,
    JobTitle:"",
    Picture:""})

    It gives me an error here:

    If(!IsBlank('Employee email'.SelectedItems),

    Im trying to input the filed with/without '' and still not accepting it. Where Im wrong?

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard