License Public Domain
Lines 29
Keywords
sharepoint   velocity   nvel (1)
Permissions
Viewable by Everyone
Editable by jeremyluerkens's Friends and "SharePoint Data Zoom Web Part Community" Group Owners
Hide
Need a quick chart or graph for your blog? Try our reStructured Text renderer. Join Siafoo Now or Learn More

Read URL, User and Look-Up Fields from a SharePoint List Atom Feed 0

In Brief Learn how to read URL, User and Look-Up fields from a SharePoint list using the Data Zoom Web Part.... more
# 's
 1## Get the DOT links list
2#set( $myLinksList = $web.lists.get_item("DOT Links") )
3
4#foreach($myLink in $myLinksList.Items)
5
6 ## Get hard to read SharePoint fields
7 #set( $urlValue = $SPFields.GetUrlValue($myLink.get_item("URL")) )
8 #set( $stateValue = $SPFields.GetLookupValue($myLink.get_item("State")) )
9 #set( $ownerValue = $SPFields.GetUserValue($web, $myLink.get_item("Owner")) )
10
11 #beforeall
12 <table class="ms-listviewtable" cellpadding="3" cellspacing="0" border="0" width="100%">
13 <tr class="ms-viewheadertr">
14 <th class="ms-vh2-nofilter">Title</th>
15 <th class="ms-vh2-nofilter">State</th>
16 <th class="ms-vh2-nofilter">Owner</th>
17 </tr>
18 #odd
19 <tr class="">
20 #even
21 <tr class="ms-alternating">
22 #each
23 <td class="ms-vb2"><a href="$urlValue.URL">$urlValue.Description</a></td>
24 <td class="ms-vb2">$stateValue.LookupValue</td>
25 <td class="ms-vb2">$ownerValue.LookupValue</td>
26 #after
27 </tr>
28 #afterall
29 </table>
30 #nodata
31 No links found
32#end

Learn how to read URL, User and Look-Up fields from a SharePoint list using the Data Zoom Web Part.

Prerequisites

This example requires two SharePoint lists.

List: "States"
  • Field: Title : Text
List: "DOT Links"
  • Field: URL : URL
  • Field: State (Look-up field using the title of the States list)
  • Field: Owner (User Field)
http://www.siafoo.net/image/156