Monday, June 13, 2011

SharePoint 2010 - Set default value for a lookup column using InfoPath and no code

If you have a look up column in your SharePoint 2010 list and want to assign a default value while adding an item (insert mode) then this post is relevant for you. Read on.

What you need to know before proceeding further:
1) You need to have InfoPath installed on your machine.
2) You need to know how you can use infopath to create custom forms for adding or editing items in the list.

See this video on how to Customize a SharePoint List Form using InfoPath 2010


Follow these steps:
1) Go to the SharePoint list and click on Customize form(under the List tab)


2) Clicking on "Customize form" will open up the InfoPath with list items (uses default page layout).

3) Click on the lookup field from the Fields list and then properties. Set the default value of the field in the default value section.



4) Make sure you have at least one item in your lookup list.

5) Enter a value in the default value text box (numeric id not text) of the default value section and click OK.

6) Publish the InfoPath by clicking on the quick publish button (on the top left corner beside save button).

You are done. You should be able to see the default value when you try to add an item to the SharePoint list.

5 comments:

  1. Thanks!! This was exactly what I was looking for! And it worked fine. Note that you do get a custom form after this action.

    ReplyDelete
  2. Is this just possible with 1 custom value?

    ReplyDelete
  3. The custom form that is produced is not acceptable in all circumstances. Would still like a non-infopath solution.

    ReplyDelete
  4. In order to set default values for lookup columns without infopath, I recommend to use this add-on:
    http://www.sparqube.com/SharePoint-Lookup-Column

    ReplyDelete
  5. I wrote a simple add-on to set the default value(s) for "Lookup" or "Person or Group" field type http://www.sharepointadd-ons.com/sharepoint_default_value

    ReplyDelete