Search the SharePoint Connector 1.3 documentation:
Index
[Downloads (PDF, HTML & XML formats)]
[Other versions]
You can use the SharePoint List macro {sp-list} to display a SharePoint list on a Confluence wiki page. The macro can display most SharePoint list types.
Screenshot: The SharePoint List macro in Confluence
On this page:
The Macro Browser is a graphical menu that allows you to view the list of available Confluence macros and add them to the current page or blog post.
To insert the SharePoint List macro into a page using the Macro Browser,
Quick guide to the SharePoint List macro
Using the simplest form of the macro, all you need to enter is the name of your SharePoint list and the list type. The macro will display default columns, based on the list type.
{sp-list:LIST NAME|LIST TYPE}
LIST NAME
' and 'LIST TYPE
' with your own values.In the example below, we show the list of documents in a SharePoint document library. The list name is 'documents
' and the list type is 'document
'.
What you need to type |
What you will get |
---|---|
{sp-list:documents|document} |
|
Make sure that you enter the entire text on a single line without any line breaks.
{sp-list:SHAREPOINT SITE ALIAS:listName=LIST NAME|columns=COLUMN 1 NAME,COLUMN 1 ALIAS,COLUMN 1 TYPE;COLUMN 2 NAME,COLUMN 2 ALIAS,COLUMN 2 TYPE|debug=TRUE}
example
).
In wiki markup, the parameters are separated by a pipe character (|). The SharePoint List macro has a slightly more complex format than other Confluence macros. For each parameter, you can enter multiple values separated by a comma (,) or a semi-colon (;). We give a detailed description in the table below.
Parameter |
Default |
Description |
---|---|---|
listname |
No default |
The first parameter can contain either just the name of the SharePoint list ('listName') or the SharePoint site alias and the list name, separated by a colon (:). The text ' {sp-list:documents|document} In the next example, the first parameter contains an alias ' {sp-list:mySharePoint:documents|document} Here is another example with alias and list name, where the parameter name ' {sp-list:mySharePoint:listName=documents|document}
Specifying the full path to your listYou must give the full path to the list. In the above example, we have assumed that the list is located at the root (top-level) SharePoint site. However, if the list is in a SharePoint site called ' {sp-list:/SiteDirectory/mySubSite/documents|document} Displaying the contents of a document folderTo display the contents of a folder ' {sp-list:/SiteDirectory/mySubSite/documents//my folder|document} |
(Unnamed parameter: List type) |
No default |
Use this parameter to specify the type of the list in SharePoint. If you do not specify the columns (see below), then you must specify the list type. If you do not specify the columns, Confluence will display default columns for the given list type. The macro supports the following list types:
|
columns |
If the 'list type' parameter is present and there is no 'columns' parameter, then SharePoint will display default columns for the given list type. |
Use this parameter to specify the columns of the SharePoint list that will be displayed on the Confluence page. If you do not specify the columns, Confluence will display default columns for the given list type. If you specify both the list type and the columns, Confluence will display the specified columns instead of the default columns. columns=COLUMN 1 NAME,COLUMN 1 ALIAS,COLUMN 1 TYPE;COLUMN 2 NAME,COLUMN 2 ALIAS,COLUMN 2 TYPE For example: {sp-list:documents|columns=BaseName,Document Name,doc;FileSizeDisplay,File Size,fileSize;Modified,,date;Author,,author;view}
|
debug |
False |
Set this parameter to 'true' if you want to send the SharePoint SOAP response to the HTML source of the page. You can see the result by viewing the source of the page. See more below. |
Below are some examples of the list types supported by the SharePoint List macro.
List types: doc, docs, document
Using the default columns:
{sp-list:test doc library|doc}
Specifying the columns:
{sp-list:test doc library|columns=BaseName,Document Name,doc;FileSizeDisplay,File Size,fileSize;Modified,,date;Author,,author;view}
Output:
List type: link
Using the default columns:
{sp-list:sample links|link}
Specifying the columns:
{sp-list:sample links|columns=URL,,url;Comments}
Output:
List types: cal, calendar
Using the default columns:
{sp-list:Sample Calendar|cal}
Specifying the columns:
{sp-list:Sample Calendar|columns=Title;Location;EventDate,Start Time,date;EndDate,End Time,date;fAllDayEvent,All Day Event,boolean}
Output:
List types: task, tasks
Using the default columns:
{sp-list:Sample Tasks|task}
Specifying the columns:
{sp-list:Sample Tasks|columns=Title;AssignedTo,,author;Status;Priority;DueDate;PercentComplete,Percent Complete,percent}
Output:
List types: issue, issues
Using the default columns:
{sp-list:sample issues|issue}
Specifying the columns:
{sp-list:sample issues|columns=ID,Issue ID;Title;AssignedTo,,author;Status;Priority;DueDate,Due Date,date}
Output:
List types: discussion, discussions
Using the default columns:
{sp-list:sample discussion|discussion}
Specifying the columns:
{sp-list:sample discussion|columns=Title;Author,,author;ItemChildCount,Replies;DiscussionLastUpdated,Last Updated,date}
Output:
List types: Not applicable
You can use the SharePoint List macro to display custom lists, provided that you specify the columns to be displayed.
Specifying the columns:
{sp-list:My Custom List|columns=Title;ID;Modified,,date;Author,,author;view}
Output:
You can add a debug parameter to your macro as follows:
{sp-list:Sample Tasks|task|debug=true}
This will cause the macro to write out the XML for the list that the SharePoint service returns. The XML is included in the HTML page, but is commented out. To see it, right click on the web page and select 'View Source'. The XML will appear as part of the source, immediately after the following line:
<!-- starting xml output
The XML contains all the available SharePoint field IDs. This is one way of finding the values for the macro column names (see above). Note that you should strip off off the prefix 'ows_
' from the field name before using it as a the macro parameter. Some field names include two underscores after 'ows
' instead of just one. In that case, you should strip off only one underscore.
For example:
Field ID shown in XML |
Column Name to use in Macro |
---|---|
ows_ServerUrl |
ServerUrl |
ows__EditMenuTableStart |
_EditMenuTableStart |