Need some help figuring out an issue with a field. Trying to add the logged in user as the default for a Created By field, but getting this error. "Network error when using patch function: The specified column is generated by the server...". The Created By field in SharePoint is a Person/Group field.
Here are the properties:
Items:
Choices([@'IS Help Desk'].'Created By')
DefaultSelectedItems:
If(Form1.Mode = FormMode.New,{
DisplayName:User().FullName,
Claims:"i:0#.f|membership|" & Lower(User().Email),
Department:"",
Email:User().Email,
JobTitle:"",
Picture:""
},Parent.Default)
Thanks - I actually just discovered what I want to do isn't possible... based on another post you responded to: Solved: To set the created by field for new and edit form ... - Power Platform Community (microsoft.com)
"You can easily display the name of the current user in a field on the new Form. You just can't Submit that field when creating the record."
Please post this as a new question. You'll get more responses and others will be able to find the answer more easily later.
@Pstork1 - this is what I am trying to accomplish now and I can't get it work. Can you please detail how this is set up? I have one Edit form tied to a SharePoint list and I want this name to be the author of the form when new and edit mode...
The difference there is the difference between a form in NEW mode and a form in Edit mode. You can check the form mode and specify the value using User().DisplayName and then when in edit mode simply add a ReadOnly data card pointed at Created by.
Thank you!!
If someone else is viewing the record, this will show the logged in user and not the user that initially created the record, right? I guess what I'm trying to do is display the username when the user is creating the record, then display the original created by user when anyone else accesses the record in the app.
You can easily display the current user's name in a label by setting the label text property to User().Fullname. But I'm not sure that is what you are asking.
Is there a way to display the User name when they're created the record, but not submit it? When I click save I'm just submitting the form.
SubmitForm(Form1)
As the error says, the Created by column is a system column and you can't edit it directly. The only way to edit it directly that I'm aware of is to use a REST call in Power Automate to change it after the item is created. You can read how to do that here:
#FlowNinja hack 78 - modifying Modified By and Modified time with Microsoft Flow — John Liu .NET
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional