Populating an Infopath dropdown using a specific Sharepoint list view
By peter.stilgoe
If you have a Sharepoint list containing multiple views, one view shows all approved items and another view shows all items that are pending approval. You have an Infopath form where you have a dropdown control that you want to be populated with only ‘Approved’ list items from your Sharepoint list.
If you create your Infopath data connection & copy the URL to this list view as your source you will notice it still returns ALL items as opposed to your filtered view listing only the approved items.
The way round this is to create you data connection using an XML source, use this link to find out how to view your list data as XML and get the source URL – http://www.petestilgoe.com/2009/11/converting-a-sharepoint-list-into-xml/
Now you need to expand on this & add the particular view to the url to make the data connection get the filtered data for you.
Currently your URL looks something like this:
/_vti_bin/owssvr.dll?Cmd=Display&List={GUID}&XMLDATA=TRUE&noredirect=true
1) Now in your Sharepoint list click ‘Settings’ –> ‘List Settings’
2) Scroll down to the bottom & click on the view you want to use as your datasource
3) Now your URL contains the {List GUID} as well as the {View GUID}
eg. /_vti_bin/owssvr.dll?Cmd=Display&List=%7BD66DCB51%2D80B0%2D43AB%2DB80B%2DCD7D23E63B09%7D&View=%7B6D0CEF69%2DF899%2D40D0%2D86B2%2D6E01CC7D9CA1%7D&XMLDATA=TRUE
4) The URL is encoded so you will need to replace “%7B” with “{” and “%7D” with “}” and “%2D” with “-” so now your url will look something like
/_vti_bin/owssvr.dll?Cmd=Display&List={D66DCB51-80B0-43AB-B80B-CD7D23E63B09}&View={6D0CEF69-F899-40D0-86B2-6E01CC7D9CA1}&XMLDATA=TRUE
5) Use this url as your XML data source in Infopath and your drop down data will be filtered as per your chosen view.
How to Prevent users from changing views in Sharepoint
By peter.stilgoe
If you need to prevent users from seeing the view menu allowing them to pick which views they want to use you can remove this easily by:
Browse to the relevant list or library
Click Site Action and select Edit Page
On the Web Part Click edit –> click Modify Shared Web Part
Change Toolbar to either ‘Summary’ or ‘No toolbar’
Now your users won’t be able to view the select ‘View’ dropdown menu
How to group by more than 2 columns in a Sharepoint view
By peter.stilgoe
Excellent step by step instructions here:
http://techtrainingnotes.blogspot.com/2008/11/sharepoint-group-by-on-more-than-2.html
Creating filtered views in Sharepoint
By peter.stilgoe
For lists and libraries with large numbers of items, users can access the items with a mix of views and search. The following are some suggestions for views that work well with an indexed column:
Recently changed: To create a view of only the items that have changed in the past week, you can index the Modified column and then apply the filter Modified (Indexed) is greater than [Today]-7.
New items: To create a view of only those items that were added in the past week, you can index the Created column and then apply the filter Created is greater than [Today]-7.
My items: To create a view of only those items that you added, you can index the Created By column and then apply the filter Created By is equal to [Me].
Due today: For lists or libraries with a Due Date column, you can index that column and then apply the filter Due Date is equal to [Today].
Discussion board updates: To create a view of only the discussions that were updated in the past month, you can index the Last Updated column on a discussion board, create a new Subject view, and then apply the filter Last Updated is greater than [Today]-30.
People and Groups: If you have a lot of people visiting your site, you can improve the performance of the All Groups and All People pages by indexing the Content Type column for the User Information List.
Even if only a few people appear on the All People page, many people visiting the site will result in inactive users being written to the User Information List, which can still affect the performance of this list.
Find links to more information about creating or changing views and about formulas and functions that you can use to filter views in the
Note: Because creating views that use a column index correctly is more complicated for large lists and libraries, you might want to remove the Manage Personal Views permission from contributors for a large list or library. By removing this permission, you can prevent users from creating a view that spans all of the items and that might adversely affect the performance of the rest of the site.



July 6th, 2010
