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 / Pre-populating a form ...
Power Apps
Answered

Pre-populating a form based on current user information from sharepoint

(0) ShareShare
ReportReport
Posted on by 10

I have a Sharepoint list that stores data on current employees. I am building a powerApp that allows the user to view and edit their own information from the list.

 

The list has multiple columns including: 

  • Name (Title) - Single Line of Text
  • E-mail - Person or group
  • Team - Choice
  • Job Role - Single Line of Text

 

I have used Sharepoint integration to 'Customize form' and edit the default form that is automatically produced in PowerApps.

 

Currently, the form pre-populates based on the first person in the list which I believe is due to the Item property related to the form:

If(IsBlank(SharePointIntegration.Selected),First([@'MyList']),SharePointIntegration.Selected)

Does anyone have a fix for this formula so that it pre-populates based on Current User rather than based on the first entry in the list?

 

I have tried various look up formulas/patch functions but I can't make it work, so any advice on best practice would be great. 

 

 

 

Categories:
I have the same question (0)
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @phoebe_pinks : Not sure if I get it right. Which scenario are you refering to: 

     

    1. Create New Item

    Usually you get a blank form as you want to create a new Item. You could Pre-Populate columns based on a given logic.

     

    - Edit Item

    This would usually load the Form with the data populated of the selected item in sharepoint.

     

     

     

     

  • phoebe_pinks Profile Picture
    10 on at

    I want them to be able to edit their item. New staff will be added by me through sharepoint directly so they will only ever need to edit, but currently the form is pre-populating with information from the first person in the list alphabetically, rather than by the current user.

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @phoebe_pinks : How do you "open" the App? Via SharePoint "Edit Item"? Or via a Link?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • phoebe_pinks Profile Picture
    10 on at

    Via link

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @phoebe_pinks OK. Thats why your SharePoint Integration control does not contain an Item information and loads the first Item.

     

    So instead of 

    First([@'MyList'])

     

    you need to LookUp an Item:

     

    LookUp([@'MyList'],'E-mail'.Email = User().Email)

     

    You might need to tweek the "E-Mail" column name.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • phoebe_pinks Profile Picture
    10 on at

    It looks like my issue is that a sharepoint integrated form can only actually be accessed via the list, is that correct? If so, I will have to create a separate app as the purpose of the app is for people to be allowed to view and edit their personal entry (according to their logged in user name). 

     

    If I'm creating a new app,  I assume the sharepoint integration won't work. If so, what would be the best practice for pre-populating the form based on the user? Lookup/patching etc?

     

  • Verified answer
    PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    I never really work with SharePoint/Customized Forms but there are "ways" of running those apps from a link. But yes, using a standalone canvas app is most of the time the better solution. So here is a quick guide: 

    1. Create a standalone canvas app
    2. Add your SharePoint List as a Datasource
    3. Add a EditForm control, set its datasource to your sharepoint list, set its Items property to"LookUp(mySharePointList,'E-mail'.Email = User().Email)​Set the Default mode of the Form to FormMode.Edit
    4. Add a Button to you app
    5. Use this formular for the OnSelect Property: SubmitForm(FormNameGoesHere)

       

      Thats it. When you play the app it should load a single record to the form.

       

  • phoebe_pinks Profile Picture
    10 on at

    Thank you for the detailed instructions. I followed the steps however I get the following error; incompatible types for comparison:

    phoebe_pinks_0-1696255909531.png

    The e-mail in my list is a person/group format but won't match to User().Email

    I tried using the Name (Title) column which is in single line of text format, but it won't match to the User().FullName  - EDIT - Played around a bit and got it working with the name rather than the e-mail, thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard