Using the sp-list Macro (v 1.1)
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:
Usage with the Macro Browser
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,
- Go to the Confluence page or blog post where you want to display the SharePoint list.
- Click the 'Edit' button. The page or blog post opens in edit mode.
- Click the Macro Browser icon on the toolbar.
- The macro browser window opens. Find the 'SharePoint List' macro:
- Scroll through the list of macros, or
- Start typing the macro name into the search box at the top right of the macro browser window. Macros with a matching name will appear in the main pane.
- Click the macro to access its parameters and preview the macro output.
- Enter the macro parameters. See the parameter descriptions below.
- If you would like to preview your changes, click 'Refresh'.
- Click 'Insert' to add the macro to the page.
Usage with the Wiki Markup Editor
Basic Form
Full Form
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}
Parameters
Separating Multiple Parameters
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. |
Examples of List Types
Below are some examples of the list types supported by the SharePoint List macro.
Document Libraries
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:
Links
List type: link
Using the default columns:
{sp-list:sample links|link}
Specifying the columns:
{sp-list:sample links|columns=URL,,url;Comments}
Output:
Calendars
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:
Tasks
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:
Issues
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:
Discussions
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:
Custom Lists
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:
The Debug Option
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 |