How to pre-populate a field in a list using listform.aspx?

Jason Forrest 1 Reputation point
2020-09-29T23:15:44.62+00:00

How do I pre-populate a field in a list using listform.aspx?

I have a list in SharePoint Online. I want to create a custom hyperlink on a 'Registration' page that a user can click on, and the list auto-fills fields by passing through information within the URL.

When I generate a direct link to the form, this is the link I get:
.......Registration/NewForm.aspx?Source=https%3A%2F%2Fqedu%2Esharepoint%2Ecom%2Fsites%2FDC1%2FLists%2FRegistration%2FAllItems%2Easpx&ContentTypeId=0x01004D3594F7D920F649AB75A8BCC8597FCF&RootFolder=%2Fsites%2FDC1%2FLists%2FRegistration

I want to be able to pass through a value to the 'Name' field, but I'm struggling to find any information on if this is even possible.
Any ideas?

I've tried adding the following at the end of the URL, but nothing seems to have any impact.

Name=Text
Name='Text'
Name="Text"
[Name]=Text
[Name]='Text'
[Name]="Text"
&Name=Text
&Name='Text'
&Name="Text"
&[Name]=Text
&[Name]='Text'
&[Name]="Text"

Any ideas?

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

1 answer

Sort by: Most helpful
  1. Allen Xu_MSFT 13,861 Reputation points
    2020-09-30T08:07:54.767+00:00

    Hi @Jason Forrest ,

    According to your description, I tested the method you mentioned in my environment, and they all failed too.

    Through my investigation and research, it is not feasible to add fields directly to the URL to achieve auto-fill fields when adding an item to a list.

    Here are two suggestions for you to get what you want:
    1.You can use JS code to auto-populate the field values:
    The article below may help you:
    Pass URL parameter to SharePoint new form (NewForm.aspx) to auto-populate a lookup field

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

    2.You can set a default value for the ‘Name’ column:
    Go to List settings->Columns section:
    29278-930case1-5.png

    Now when you click the hyperlink in your 'Registration' page and redirect to the ‘New Item’ page, the ‘name’ field will be filled with value by default.

    If you are still confused about this, please feel free to let me know.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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 Answers by the question author, which helps users to know the answer solved the author's problem.