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

Set current user as default value of Person or Group field

We are using O365. I have some list with some columns. One of the columns is of the type "Person or Group". I customized the detail form in PowerApps. The detail form is used for new, display and edit of list items. I would like to set the current user in this "Person or Group" field.

 

I found some posts on this forum where you need to create a new datasource "Office365Users". And then you need to set this as default value:

 

Office365Users.MyProfile()

 

 

But this is not working. When I create a new list item, I see the default value is set with the current user. But when I save the list item I got an validation error. Is there a solution to make this work?

17 REPLIES 17

In my case Field is not displaying the name its just empty . but when i save its storing in sharepoint list .

I am trying this solution and if I accept the current user as the entry then it works fine and the value is stored.

However, if I edit the entry, using the dropdown, to select an alternative person the *current user* is still stored as the value in the list.

I have pasted exactly as show apart from editing DataCardValue10.Selected to DataCardValue11.Selected appropriately for my datacard.

 

 

Anonymous
Not applicable

Thanks,
This works perfect and suits to my project. Better than the previous untesteted one by another person.

Hello,

I am trying a very similir thing (without success): fill in the current user in a (single) person group field. 
I tried all of the solutions discussed here (with and without if() function) but I always get an
error message that there is an unexpected character. The formula contains ParentClose but "Error" is expected.

 

I am trying this formula in the field DefaultSelectedItem:

{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|"&User().Email,
DisplayName: User().FullName
}

---> with and without the @odata field.

 

The Powerapp form is only used to modifiy a listitem, the item itself is generated with a flow. The column is set to required=true within the Powerapp and is set to "not visible". The powerapp is the form connected to the sharepoint list.

Hei 

Send me your email i will send u what i had done 


@OlafStetzer wrote:

Hello,

I am trying a very similir thing (without success): fill in the current user in a (single) person group field. 
I tried all of the solutions discussed here (with and without if() function) but I always get an
error message that there is an unexpected character. The formula contains ParentClose but "Error" is expected.

 

I am trying this formula in the field DefaultSelectedItem:

{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|"&User().Email,
DisplayName: User().FullName
}

---> with and without the @odata field.

 

The Powerapp form is only used to modifiy a listitem, the item itself is generated with a flow. The column is set to required=true within the Powerapp and is set to "not visible". The powerapp is the form connected to the sharepoint list.


 

Dears,

 

I have a Created BY datacard which is a Person Group field type but combo box in powerapps.

Kindly help me to get the current logged in user on opening NEW form and on edit of same form, the created by field must be populated.

I tried the above given solutions but unable to achieve it.

 

Thanks in advance.

 

rebeccas
Community Champion
Community Champion

If you do it on the default selected that will only SHOW the current user. You also need to put that same table format data on the Update of the card for your form. I do not think this always been the case but it is now. 

In my Case:
Items: 

UsuariosdeOffice365.SearchUser({top:999,searchTerm:ComboBox10.SearchText})

DefaultSelectedItems: ( I chage the field "Email" by "Mail")

If(Form7.Mode = New,
    {
        DisplayName:GalleryAud_1.Selected.ResponsableProceso.DisplayName,
        Claims: "i:0#.f|membership|" & Lower(GalleryAud_1.Selected.ResponsableProceso.Email),
        Mail:GalleryAud_1.Selected.ResponsableProceso.Email
   },
    ThisItem.ResponsableProceso)

Update:

{  
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
DisplayName:ComboBox10.Selected.DisplayName,
Claims:"i:0#.f|membership|" & Lower(ComboBox10.Selected.Mail),  
Department:"",
Email:ComboBox10.Selected.Mail,  
JobTitle:"",  
Picture:""  
}

 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,770)