Skip to main content

Task SharePoint - Get List Item​

The SharePoint - Get list item(s) Task returns the items of a list on a SharePoint site that match a CAML query, with the fields you choose, using a SharePoint Connection.

The SharePoint Tasks work with SharePoint 2010, 2013 and 2016 on premises, and with SharePoint Online.

Get list item(s) tab with the Connection, Title list, CAML Query box and the Field(s) grid

warning

This Task uses a SharePoint Connection; see Connection - SharePoint. When a certificate is selected in the Connection, the Task accepts any server certificate, and each run of a SharePoint Task changes TLS handling for the whole Server process.

The Main settings, Flow, On error, Conditions and TimeOut tabs are the same for every Task; see Job - Tasks.

Get list item(s) tab​

  • Connection: the SharePoint Connection to use. The button next to the list manages Connections
  • Title: the title of the list. Click the button next to the box to show the lists of the site
  • CAML Query: the query in CAML format that selects the items. The default, <View><Query></Query></View>, selects all items. The button next to the box opens the CAML query builder
  • Field(s): one row for each field of the list, with the columns Use and Name. Check Use for each field to return. Click Refresh fields to fill the grid with the fields of the list in Title

Variables are resolved in Title, CAML Query and the field names.

Get list item(s): Output tab​

The Output tab sets the format of the result:

  • Output to standard output (default) or Output to file: where the result is written
  • Include field names: write the names of the checked fields as the first line
  • Field separator, Text qualifier and Line break: the character between fields, the character around each value, and the line break between items
  • Indent XML: not used by this Task
  • File output settings: with Output to file, the Credential to write the file as, File path, Append to file and Include BOM (if UTF8)

Output and errors​

The output of the Task is one line for each item, with the values of the checked fields in the order of the grid. A person or lookup field returns the display value; several people are separated by ";". When the list cannot be read or the query is not valid, the Task fails with the error from SharePoint.