cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

autopopulate person or group field with author

Hi , 

 

I have a field of type Person or groupp in Sharepoint. 

In powerapps, i created the form and it shows mw a drop down , where I search for the name and select .

 

What I want is , by default this field should be populated with the author name

 

any suggestion ?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @ssvk,

 

What @dinusc suggested would only work when editing exsiting records, not the new ones. Please try below below formula on the Default property of the Person and Group data card. This works both with NewForm/EditForm mode for me:

If(IsBlank(ThisItem.Person),
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & Lower(User().Email), Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:".", Picture:"."},
ThisItem.Person)

 

Person is the column name.

 

1.PNG

 

 

Capture.PNG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Microsoft
Microsoft

Hello @ssvk,

 

By "author name" I assume you mean the value of "Created By" field which is the row author. If so then all you need to do is to find the card name that is bound to the "Created By" field (for example DataCard1) and then set the following formula in the ComboBox "DefaultSelectedItems" field:

If(IsBlank(Parent.Default),DataCard1.Default,Parent.Default)

Note that you will have to unlock the card that contains the ComboBox control before you can update the "DefaultSelectedItems" field.

Community Support
Community Support

Hi @ssvk,

 

What @dinusc suggested would only work when editing exsiting records, not the new ones. Please try below below formula on the Default property of the Person and Group data card. This works both with NewForm/EditForm mode for me:

If(IsBlank(ThisItem.Person),
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & Lower(User().Email), Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:".", Picture:"."},
ThisItem.Person)

 

Person is the column name.

 

1.PNG

 

 

Capture.PNG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,587)