How to fill data to custom column from other columns automactically while uploading document

Pongthorn Sangkaphet 1 Reputation point
2022-05-18T10:46:07.617+00:00

Hi everyone

I want to upload a file to the Sharepoint library. I need to avoid manual filling values in each column.
How to automatically fill data to any custom attributes by the following steps.

It is done programmatically and simple setting in a list setting?

  1. A custom column named DocTitle, would be copied the value from the Name column.
  2. A custom column named DocYear, is filled with a value from the Year of the current date.

203201-image.png

Microsoft 365 and Office | SharePoint | Development
{count} votes

1 answer

Sort by: Most helpful
  1. Tong Zhang_MSFT 9,256 Reputation points
    2022-05-19T05:35:16.937+00:00

    Hi @Pongthorn Sangkaphet ,

    Do you want to upload files programmatically? As a workaround ,I recommend you use Power Automate to create a workflow to achieve the functionality you need. You can following these steps:

    1. Choose 'When a file is created or modified (properties only)' ->> input Site Address and Library Name
    2. Choose 'Update file properties' (As shown in the screenshot)
      203524-001.png
    3. Click Save and the filename will be filled automatically to the "DocTitle" (Note: When you click "Upload" and upload the file, you may need to wait a few minutes and then refresh the list, the "DocTitle" will be automatically filled)
      203576-image.png 4.Create "DocYear" column and use Calculated Field with following formula: =CONCATENATE(YEAR(Created)) ,then the column "DocYear" will be filled with the current year
      Go to Library Setting >> Create Column
      203525-image.png

    My test result:
    203514-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.