Hi,
I have a person/group column in SharePoint list. Through the form I want to pass the form filled users username to it. and this will not be change in display form. need to get the username automatically when user filled the form and it should be on disabled mode.
currently When I do this it will submit the username but when any other user view it from sharepoint his/her username will appers, not the original username who submitted.
how can I solve this issue? need help.
Solved! Go to Solution.
Hi you can use below formula
If(SharePointForm1.Mode=FormMode.New, {
Claims: "i:0#.f|membership|" & Lower(User().Email),
DisplayName: User().FullName,
Email: User().Email,
Picture: "",
Department: "",
JobTitle: ""}, Parent.Default)
Add the above formula in DefaultSelectedItems property
Hi,
In the defaultselecteditems property of your person data card you have to add condition to check whether form is on which mode -
If(SharePointForm1.Mode=FormMode.New, {Your formula to set current logged in user}, Parent.Default)
Hi , thank your for your response. I think the way I check the user is also a problem. Can you let me know how to get that. Follow code is I used to fill the field with current logged user.
{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & User().Email,
DisplayName:User().FullName
}
This code both written on default and defaultselecteditems.
Hi you can use below formula
If(SharePointForm1.Mode=FormMode.New, {
Claims: "i:0#.f|membership|" & Lower(User().Email),
DisplayName: User().FullName,
Email: User().Email,
Picture: "",
Department: "",
JobTitle: ""}, Parent.Default)
Add the above formula in DefaultSelectedItems property
Thank you.
User | Count |
---|---|
253 | |
113 | |
92 | |
48 | |
38 |