SOLVED

Document library set current user as value for custom person column when uploading file

Copper Contributor

Hi, 

 

We have a shared document library. To maintain an overview of responsibility for the content stored there, we have added a required custom "owner" column. 

We want to have this seperate custom column in addition to the standard created_by, as we want to be able to transfer responsibility to a different person.

 

We would like this person column to be filled in by default with the name of the current user when someone adds a file. This to avoid missing data.

Can this be done?

 

 

3 Replies
best response confirmed by Ljanssen86 (Copper Contributor)
Solution

@Ljanssen86 

if you want a Person Field for this then you might be able to use a Flow to populate the field when new document is created. 

Else you can use a Calculated Column and copy the Created By value as default, but it might be a Read-only field.

@mvnair 

Thank you for the reponse.

We have been able to fill the column with the created by value. 

So far this seems to work for files uploaded, but not yet for newly created files. We are still looking into this.

@Ljanssen86 

I tried the following json on column formatting of a new Text column to dislay the name of the Created By (or Modified by) and it works on new docs or when you upload.
You can use $Editor to display Modified By user details.

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "[$Author.title]"
}

 

 

1 best response

Accepted Solutions
best response confirmed by Ljanssen86 (Copper Contributor)
Solution

@Ljanssen86 

if you want a Person Field for this then you might be able to use a Flow to populate the field when new document is created. 

Else you can use a Calculated Column and copy the Created By value as default, but it might be a Read-only field.

View solution in original post