Procedures
Automation procedures in the Microsoft SharePoint BDK Book.
Make sure to add both the Microsoft SharePoint (BDK) and the Microsoft Office 365 (BDK) Books to your agent before using these automation procedures.
to add a column to a slist
Adds a column to a given SharePoint list using the Microsoft Graph API.
For now, it will remain the same as the BCI version. In the future, we should try to support more col types, opening up the configuration for them.
Input Concepts
name
The name of the column to be added.
text
Yes
description
The description of the column to be added.
text
No
Examples
add a column to the list
the name is "NewColumn"
the description is "The newest column"
to add an (item) to a slist
Adds an item to a given SharePoint list using the Microsoft Graph API.
Input Concepts
item
The item to be added to the list. The fields in the Dict should match the column names in the list.
``
Yes
Output Concepts
Examples
create a json
use the above as the item body
set the item body's "Title" to "First Item"
set the item body's "column1" to "col 1 value"
add the item body to the list
to copy an item to a folder
Copies an item (folder or file) to a given folder using the Microsoft Graph API.
Input Concepts
item
The item (folder or file) that will be copied.
sharepoint file reference
or sharepoint folder reference
Yes
item name
The new name for the copy. If this isn't provided, the same name will be used as the original.
text
No
conflict behavior
The behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.
text
No
rename
Examples
Copy an item to a folder
get a folder at "/My Site/My Documents/My Folder"
use the above as the source folder
get a folder at "/My Site/My Documents/My Other Folder"
use the above as the destination folder
copy the source folder to the destination folder
to create a (folder) in a document library
Creates a new folder at the root of the given SharePoint document library using the Microsoft Graph API.
Input Concepts
The document library where the folder will be created.
sharepoint document library
Yes
folder name
The name of the folder to be created.
text
Yes
conflict behavior
The behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.
text
No
rename
Output Concepts
A sharepoint document library folder representing the created folder.
sharepoint folder reference
Examples
Create a folder named "My New Folder" in the document library "My Documents" the folder name is "My New Folder"
get site from sharepoint whose name is "Human Resources"
get some site's document libraries
create a folder in the first library
to create a (folder) in another folder
Creates a new folder at the given SharePoint document library item using the Microsoft Graph API.
Input Concepts
folder name
The name of the folder to be created.
text
Yes
conflict behavior
The behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.
text
No
rename
Output Concepts
A sharepoint document library item representing the created folder.
sharepoint folder reference
Examples
Create a folder named "My New Folder" under the folder "My Folder"
get a folder at "/My Site/My Documents/My Folder"
use the above as the another folder
create a folder in another folder where the folder name is "My New Folder"
to create a list in a sharepoint site
Creates a new list in a given SharePoint site using the Microsoft Graph API.
Input Concepts
list name
The name of the list to be created.
text
Yes
Output Concepts
Examples
create a list in the site
the list name is "My List"
to delete a column from a list
Deletes a column from a given SharePoint list using the Microsoft Graph API.
Input Concepts
Examples
delete the column from the list
to delete a slist
Deletes a list in a given SharePoint site using the Microsoft Graph API.
Input Concepts
to delete an item
Deletes an item (folder or file) within a given SharePoint document library using the Microsoft Graph API.
Input Concepts
item
The item (folder or file) to be deleted.
sharepoint file reference
or sharepoint folder reference
Yes
Examples
Delete an item
get a folder at "/My Site/My Documents/My Folder"
get the folder's items
delete the first item
to delete an item from list
Deletes one or many items in a given SharePoint list using the Microsoft Graph API.
Input Concepts
item
The item or items to be deleted.
list of sharepoint list item
or sharepoint list item
Yes
Examples
delete the created item in list
get the list as the slist
get the slist's items whose "Title" is "First Item"
use the above as the items
delete the items in list
to download a file
Downloads a file from a given SharePoint document library using the Microsoft Graph API.
Input Concepts
Output Concepts
answer
The downloaded file
file
Examples
Download a file
get a folder at "/My Site/My Documents/My Folder"
get the folder's items
download the first item
to edit an item
Edits an item in a given SharePoint list using the Microsoft Graph API.
Input Concepts
Examples
The created item is a JSON or a SharepointListItem concept
set the created item's "field.Title" to "Updated Title"
edit the created item
to get a (folder's items)
Retrieves all child items from the specified document library folder using the Microsoft Graph API.
Input Concepts
Output Concepts
folder's items
A list of items within the specified document library item.
sharepoint file reference
or sharepoint folder reference
Examples
Retrieve all items from the folder "My Folder"
get a folder at "/My Site/My Documents/My Folder"
get the folder's items
to get a (folder) at a path
Retrieves the root folder of a given SharePoint document library using the Microsoft Graph API.
Input Concepts
path
The path to the folder to retrieve with the following format: ////...
text
Yes
Output Concepts
A sharepoint document library item representing the folder at the specified path.
sharepoint folder reference
Examples
Retrieve the root folder of the document library "My Documents" in the site "My Site"
get a folder at "/My Site/My Documents"
Retrieve the folder "My Folder" within the document library "My Documents" in the site "My Site"
get a folder at "/My Site/My Documents/My Folder"
to get a (root folder) from a document library
Retrieves the root folder of a given SharePoint document library using the Microsoft Graph API.
Input Concepts
The document library from which to retrieve the root folder.
sharepoint document library
Yes
Output Concepts
Examples
Retrieve the root folder of the document library "My Documents"
get site from sharepoint whose name is "Human Resources"
get some site's document libraries
use the above as the testing libraries
get a root folder from the first testing library
to get some (items) from a document library
Retrieves all items within a given SharePoint document library using the Microsoft Graph API.
Input Concepts
Output Concepts
items
A list of items within the specified document library.
sharepoint file reference
or sharepoint folder reference
Examples
get site from sharepoint whose name is "Human Resources"
get some site's document libraries
to get some (site's document libraries)
Retrieves all document libraries within a given SharePoint site using the Microsoft Graph API.
Input Concepts
A SharePointSite object representing the site from which to retrieve document libraries.
sharepoint site
Yes
Output Concepts
A list of document libraries within the specified site.
sharepoint document library
Examples
get site from sharepoint whose name is "Human Resources"
get some site's document libraries
to get some (sites) from sharepoint
Retrieves SharePoint sites accessible via the Microsoft Graph API.
Output Concepts
Examples
Retrieve accessible sites from SharePoint
get sites from sharepoint
process each site as follows
say site's name
Retrieve a single site by name
get sites from sharepoint whose name is "Human Resources"
to get some (slist's items)
Retrieves all items within a given SharePoint list using the Microsoft Graph API.
When using it, it is very important to mark the item you are working with as a "slist" (Sharepoint list) so that the Brain matches this procedure.
Input Concepts
include empty columns
Whether to include empty columns in the table.
boolean
No
False
limit
The maximum number of items to retrieve.
number
No
Output Concepts
Examples
Get the items in a list
get the list as the slist
get the slist's items
Get the items in a list filtered by a column
get the list as the slist
get the slist's items whose "Title" is "First Item"
Get the items in a list filtered by a column and include empty columns
get the list as the slist
get the slist's items whose "Title" is "First Item"
the include empty columns is "True"
to move an item to a folder
Moves an item (folder or file) to a given folder using the Microsoft Graph API.
Input Concepts
item
An item (folder or file) that will be moved.
sharepoint file reference
or sharepoint folder reference
Yes
file name
The new name for the move. If this isn't provided, the same name will be used as the original.
text
No
conflict behavior
The behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.
text
No
rename
Examples
Move an item to a folder
get a folder at "/My Site/My Documents/My Folder"
use the above as the source folder
get a folder at "/My Site/My Documents/My Other Folder"
use the above as the destination folder
move the source folder to the destination folder
to rename a (slist)
Renames a list in a given SharePoint site using the Microsoft Graph API.
Input Concepts
name
The new name for the list.
text
Yes
Output Concepts
Examples
rename the list
the name is "My Renamed List"
to rename a column in a list
Edits a column in a given SharePoint list using the Microsoft Graph API.
IMPORTANT: This rename does not affect the internal name of the column, only the display name.
Input Concepts
new column name
The new name for the column.
text
Yes
description
The new description for the column.
text
No
Output Concepts
Examples
rename the column in the list
the new column name is "New Column Name"
the description is "The new column description"
to rename an item to a name
Renames a folder or a file using the Microsoft Graph API.
Input Concepts
item
A SharePoint file that will be renamed.
sharepoint file reference
or sharepoint folder reference
Yes
name
The new name for the file.
text
Yes
conflict behavior
The behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.
text
No
rename
Examples
Rename a file
get a folder at "/My Site/My Documents/My Folder"
get the folder's items
rename the first item to "My New File.txt"
to retrieve a slist as a (table)
Retrieve a sharepoint list as a table.
Input Concepts
include empty columns
Whether to include empty columns in the table.
boolean
No
False
Output Concepts
table
The list as a table.
table
Examples
retrieve the list as a table
to retrieve some (column definitions) from a slist
Retrieves the column definitions of a given SharePoint list using the Microsoft Graph API.
Input Concepts
Output Concepts
Examples
retrieve column definitions from the list
retrieve column definitions from the list whose name is "Title"
to retrieve some (site's lists)
Retrieves all lists within a given SharePoint site using the Microsoft Graph API.
Input Concepts
A SharePointSite object representing the site from which to retrieve document libraries.
sharepoint site
Yes
limit
The maximum number of lists to retrieve.
number
No
Output Concepts
Examples
get some sites from sharepoint whose name is "Human Resources"
use the above as the site
retrieve the site's lists
get some sites from sharepoint whose name is "Human Resources"
use the above as the site
retrieve the site's lists whose name is "My List"
to retrieve some (site's subsites)
Retrieves all subsites within a given SharePoint site using the Microsoft Graph API.
Input Concepts
A SharePointSite object representing the site from which to retrieve subsites.
sharepoint site
Yes
Output Concepts
to upload a file to a folder and get the file reference
Uploads a file to a given SharePoint document library using the Microsoft Graph API.
Input Concepts
file
The content of the file to be uploaded as bytes.
file
Yes
file name
The name of the file to be uploaded.
text
Yes
conflict behavior
The behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.
text
No
rename
Output Concepts
Examples
Upload a file named "My File.txt" to the folder "My Folder" the file name is "My File.txt"
get a folder at "/My Site/My Documents/My Folder"
use the above as the folder
the new file # This will ask a question, you need to upload a file
upload the new file to the folder
Last updated
Was this helpful?