Skip to content

Command Line Interface tool for executing actions on sharepoint lists and libraries

License

Notifications You must be signed in to change notification settings

exxmen/sharepointdirect

Repository files navigation

SharePointDirect CLI

SharePointDirect is a command line interface that can be used by Robotic Process Automation solutions that do not have the capability to connect to SharePoint Online directly and needs to execute some Sharepoint actions (see functionalities/methods available below).

Built with

Methods

All methods writes the result to the console or a textfile or to a csv file.

Please note that column IDs should be provided instead of column names.

  • GetNumberOfItems - Gets the number of items in the provided list. Writes the result to C:\Apps\GetNumberOfItems.txt
  • GetItemId - Gets the ID of the item by title. Writes the result to C:\Apps\GetItemId.txt
  • AddItem - adds an item to the list Writes the result to C:\Apps\AddItem.txt
  • DeleteItemById - deletes an item from the list using a provided ID. Writes the result to C:\Apps\DeleteItemById.txt
  • UploadFileWithMeta - uploads a file to a specified library and adds the given properties. Writes the result to C:\Apps\UploadFileWithMeta.txt. Please note that the current version does not work when uploading to sub folders.
  • UploadFileNoMeta - uploads a file to a specified library with no properties. Writes the result to C:\Apps\UploadFileNoMeta.txt. Please note that the current version does not work when uploading to sub folders.
  • GetOneItem - Gets an item from the list based on a given title and writes the requested field name and field value to a txt file. Writes the result to C:\Apps\GetOneItem.txt.
  • GetOldestItem - Gets the oldest item from the list. When successful, writes the result to C:\Apps\GetOldestItem.csv.
  • GetItems - Gets the x number of items from provided list based on the columns provided. When successful, writes the result to C:\Apps\GetItems.csv.

Usage:

Build the Solution

copy the debug/release folder to any destination then rename it

cd [renamed folder]

SharePointDirect [Method] <options>

In your Robotic Process Automation solution, execute the program via the command prompt with the required arguments

Examples:

GetNumberOfItems:

SharePointDirect GetNumberOfItems URL Listname

GetItemId:

SharePointDirect GetItemId URL Listname ItemTitle

AddItem:

SharePointDirect AddItem URL Listname Field Value

DeleteItemById:

SharePointDirect DeleteItemById URL Listname ID

UploadFileWithMeta:

SharePointDirect UploadFileWithMeta URL Listname Filepath <PropertyKey, PropertyValue>...

UploadFileNoMeta:

SharePointDirect UploadFileNoMeta URL Listname Filepath

GetOneItem:

SharePointDirect GetOneItem URL Listname <FieldName1 FieldName2>...

GetOldestItem:

SharePointDirect GetOldestItem URL Listname

GetItems:

SharePointDirect GetItems URL Listname NumberOfRows <Column1 Column2 Column... >

Authors

  • Exx Navarro - Initial work - exxmen

See also the list of contributors who participated in this project.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Please note that you need to have Visual Studio and at least .NET 4.1 installed on your machine to contribute

git clone https://github.com/exxmen/sharepointdirect.git

cd SharePointDirect

Build Solution in Visual Studio

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Hat tip to anyone whose code was used. If you want to be mentioned, please let me know.
  • Inspired by Marcin's awesome Excel SharePoint REST API based tool

About

Command Line Interface tool for executing actions on sharepoint lists and libraries

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages