Renames a folder or a file using the Microsoft Graph API.
Input Concepts
Concept
Description
Type
Required
Default Value
item
A SharePoint file that will be renamed.
sharepoint file reference or sharepoint folder reference
Yes
(no default)
name
The new name for the file.
text
Yes
(no default)
conflict behavior
The behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.
text
No
rename
Examples
Rename a file
to retrieve a (document library) at a url
Retrieves a SharePoint document library by its web URL using the Microsoft Graph API.
URL Structure: https://{tenant}.sharepoint.com/sites/{sitename}/{libraryname} Example: https://contoso.sharepoint.com/sites/bdk-testing/Shared%20Documents/Forms/AllItems.aspx Note: The library name is extracted from the URL path. Extra path segments like "Forms/AllItems.aspx" are ignored.
Get a document library by URL and list its contents
to retrieve a (file) at a url
Retrieves a SharePoint file by its web URL using the Microsoft Graph API.
URL Structure: SharePoint sharing link format with a file type indicator: https://{tenant}.sharepoint.com/:{type}:/s/{sitename}/{encoded-file-id}?e={share-token} File type indicators: ❌ (Excel), :w: (Word), :p: (PowerPoint), ⭕ (OneNote), :u: (other) Example: https://contoso.sharepoint.com/❌/s/bdk-testing/IQBeb0d3aEHrQ6FjalfpQ0YMAaGJLzwchRkDm49QQonv9Zs?e=kMch0g To get this URL: Right-click on the file in SharePoint and select "Copy link".
Input Concepts
Concept
Description
Type
Required
Default Value
url
The web URL (sharing link) of the file to retrieve.
Retrieves a SharePoint folder by its web URL using the Microsoft Graph API.
URL Structure: SharePoint sharing link format with :f: indicating a folder: https://{tenant}.sharepoint.com/:f:/s/{sitename}/{encoded-folder-id}?e={share-token} Example: https://contoso.sharepoint.com/:f:/s/bdk-testing/IgAu9BS6my2MRKogPH9TanUJAdITnMhz9MC63mh2yYcQofw?e=Qg73q2 To get this URL: Right-click on the folder in SharePoint and select "Copy link".
Input Concepts
Concept
Description
Type
Required
Default Value
url
The web URL (sharing link) of the folder to retrieve.
Retrieves a SharePoint list by its web URL using the Microsoft Graph API.
URL Structure: https://{tenant}.sharepoint.com/sites/{sitename}/Lists/{listname}/AllItems.aspx Example: https://contoso.sharepoint.com/sites/bdk-testing/Lists/BDK%20Test%20List%201/AllItems.aspx Note: The list name is extracted from the path segment after "Lists/". The "/AllItems.aspx" suffix is optional and ignored if present.
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
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
get site from sharepoint whose name is "Human Resources"
get some site's document libraries
create a folder in the first library
get a folder at "/My Site/My Documents/My Folder"
use the above as the other folder
create a folder in the other folder
the folder name is "My New Folder"
create a list in the site
the list name is "My List"
delete the column from the list
delete the list
get a folder at "/My Site/My Documents/My Folder"
get the folder's items
delete the first item
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
get a folder at "/My Site/My Documents/My Folder"
get the folder's items
download the first item
set the created item's "field.Title" to "Updated Title"
edit the created item
get a folder at "/My Site/My Documents/My Folder"
get the folder's items
get a folder at "/My Site/My Documents"
get a folder at "/My Site/My Documents/My Folder"
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
get site from sharepoint whose name is "Human Resources"
get some site's document libraries
get site from sharepoint whose name is "Human Resources"
get some site's document libraries
get sites from sharepoint
process each site as follows
say site's name
get sites from sharepoint whose name is "Human Resources"
get the list as the slist
get the slist's items
get the list as the slist
get the slist's items whose "Title" is "First Item"
get the list as the slist
get the slist's items whose "Title" is "First Item"
the include empty columns is "True"
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
rename the list
the name is "My Renamed List"
rename the column in the list
the new column name is "New Column Name"
the description is "The new column description"
get a folder at "/My Site/My Documents/My Folder"
get the folder's items
rename the first item to "My New File.txt"
retrieve a document library by url "https://contoso.sharepoint.com/sites/HR/Documents"
retrieve a document library by url "https://contoso.sharepoint.com/sites/Finance/Shared Documents"
use the above as the library
get some items from the library
retrieve a file by url "https://contoso.sharepoint.com/:x:/s/HR/AbC123..."
retrieve a file by url "https://contoso.sharepoint.com/:w:/s/Finance/XyZ789..."
use the above as the file
download the file
retrieve a folder by url "https://contoso.sharepoint.com/:f:/s/HR/AbC123..."
retrieve a folder by url "https://contoso.sharepoint.com/:f:/s/Finance/XyZ789..."
use the above as the folder
get the folder's items
retrieve a site at "https://contoso.sharepoint.com/sites/HR"
retrieve a site at "https://contoso.sharepoint.com/sites/Finance"
use the above as the site
retrieve the site's lists
retrieve a slist by url "https://contoso.sharepoint.com/sites/HR/Lists/Employees"
retrieve a slist by url "https://contoso.sharepoint.com/sites/Projects/Lists/Tasks"
use the above as the slist
get the slist's items
retrieve the list as a table
retrieve column definitions from the list
retrieve column definitions from the list whose name is "Title"
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"
use the above as the site
retrieve some site's subsites
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