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 / Submit new form with d...
Power Apps
Answered

Submit new form with data from MyProfileV2 in to a person/group column

(0) ShareShare
ReportReport
Posted on by 79

I have a form that when it is in new mode, I want to populate the name box with the current user.  The name box is a combo box that pulls from our directory and lets you pick your name from the list.  I have the current user's profile stored in a variable.  The variable is set when the app starts ie:  varUser, Office365Users.MyProfileV2().  I can get the name field to display the current user's name when I open the form in new mode with this code:

 

If(EditForm1.Mode = FormMode.New, {Value: varUser.displayName}, ThisItem.'Bureau Name')

 

It checks to make sure it is in new mode otherwise it plugs in the name from the record that is being edited.  The form is used for both new and editing records.  

 

The issue I have is that when I submit the form, the name does not save in the SharePoint list.  I'm pretty sure it has to do with the fact that the column on the SharePoint list is a person/group type.

 

Any idea how to make this work?

 

Thanks!

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Mike_N,

    Could you please tell me that:

    1). how you set the Items property of this combobox?

    2). how you set the Update property of the data card including this combobox?

     

    Anyway, try to set the Update property as below:

    { 
     DisplayName:varUser.displayName,
     Claims:"i:0#.f|membership|" &Lower(varUser.mail), 
     Department:"", 
     Email:varUser.mail, 
     JobTitle:"", 
     Picture:""
    }
  • Mike_N Profile Picture
    79 on at

    So the combobox/datacard is part of a form that gets it's data from the datasource property of the form which is [@'EMS STAT (AAR)'].

     

    The default value of the combobox/datacard is set to ThisItem.'Bureau Name' which when you are editing a record shows you the name associated with the recortd and when it's a new recored is blank, obviously.  


    The update property of the datacard is set to DataCardValue9.Selected (yes I know my naming conventions need work....this was one of my first apps)

     

    I have a button on the top right that is set to SubmitForm(EditForm1).  That is how a new recored or edited record is submitted.

     

    Hope that answers your questions.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Mike_N,

    Have you tried my solution?

     

    "So the combobox/datacard is part of a form that gets it's data from the datasource property of the form which is [@'EMS STAT (AAR)']."

    Do you mean you use the Choices(listname.'EMS STAT (AAR)')?

     

    I think I have already provided a correct solution, the following is my testing result:

    vqiaqimsft_0-1694742800794.png

    Since you have a form, you just need to set the Update property with the previous formula I provide:

    { 
     DisplayName:varUser.displayName,
     Claims:"i:0#.f|membership|" &Lower(varUser.mail), 
     Department:"", 
     Email:varUser.mail, 
     JobTitle:"", 
     Picture:""
    }
  • Verified answer
    Mike_N Profile Picture
    79 on at

    I was able to get this to work with the default set to the following:

    If(EditForm1.Mode = FormMode.New, {DisplayName:varUser.displayName,
    Claims:"i:0#.f|membership|" & Lower(varUser.mail)}, ThisItem.'Bureau Name')

     

    Found a similar post here that didn't show up when i searched for a solution.  

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Set-ComboBox-Default-to-Current-User-and-Save-in-Sharepoint-List/td-p/375527

     

    Thanks for the 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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 404

#2
timl Profile Picture

timl 344 Super User 2026 Season 1

#3
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

Last 30 days Overall leaderboard