Wednesday, 22 April 2009

Creating a simple feedback or request form Web Part using SharePoint Designer

Here are some steps you can use to create a Web Part using SharePoint Designer that displays a new item form for a list with a submit button. It provides an interface for users to be able to post feedback or requests for information (brochures, documents, etc.) without having to go to the standard new item form for the list. The advantage here is that you can add this Web Part to a dashboard or home page to provide a better user experience.

  • First, we need to create the list. In this example, I would like to give users the option of requesting a number of different brochures. I have created a custom list called “Brochure Requests” with the following columns (I have renamed the default “Title” column to “Your Name”) – The “Brochure Type” column allows the user to choose which documents they wish to be sent:

image

  • Go to the page on the site where the Web Part will be created (To prevent the live page from being customised by SharePoint Designer, you may want to create the Web Part on a dummy page in the same site, export it to a file, import it on the live page, and delete the dummy page).
  • Edit the page in SharePoint Designer, click on the Web Part zone, and select Insert Data View from the Data View menu.
  • From the Data Source Library, click on your custom list and select Show Data.

image

  • Select the columns that you would like to show in the Web Part (for my example, I have chosen Your Name, Your Address, and Brochure Type), click the Show Selected Fields as… button, and select New Item Form.

image

  • The Web Part will now appear in the page. From here you can change all sorts of options to style it how you want. I need to change the text on the Save button to Submit, so I have double-clicked the button and changed the Value/label setting.
  • Once finished, save the page.
  • Go to the page in the browser and give it a try.

image

When users click the Submit button, the item will be created in the list. Because the columns are referenced directly from the Web Part, if you make any changes to them (e.g., add a new brochure type), these will automatically appear in the Web Part.

Once this has been done, you can start adding more out-of-the-box functionality to the list. For example, you could set up an alert on the list so that members of the reception desk receive an e-mail when a new brochure request has been posted. They can then go to the item directly from the e-mail and send the brochure to the address specified by the site visitor. You could also have a “Brochure Sent” yes/no column created in the list that was exposed in a “Brochures to be sent” list view, so that reception workers can view outstanding items and confirm when a brochure has been sent to clear it from the list view.

3 comments:

  1. Hi Phil! This works great, but I'm getting an error that doesn't make sense to me. I followed everything above, and upon save it does save to my little list, but the user sees "You must specify a value for this required field", which DID have a value in it. Is it possible that the "Save" button is called 2X somewhere? I didn't hit it twice, and it happens each and every time. Has this ever happened to you?

    ReplyDelete
  2. I'm afraid not - I have tried it a few times as documented in this article and it worked well

    ReplyDelete
  3. Hi Phil,

    Thanks for this, was very useful. It works and all but my problem is that the submitted form directs the visitor to a SitePages area where the form submissions are captured rather than stay on the Pages (publicly accessible) site.

    Is there a way to fix this so it would go to a "thank you" page?

    Thanks for your help!

    ReplyDelete