
Siafoo – the intersection of pastebin, help desk, version control, and social networking
Join Siafoo Now
or
Learn More
Read URL, User and Look-Up Fields from a SharePoint List
0
In Brief | Learn how to read URL, User and Look-Up fields from a SharePoint list using the Data Zoom Web Part.... more |
Language | Text only |
# '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)
Add a Comment