Examples

End-to-end automation examples using the SharePoint BDK Book.

Overview

The SharePoint Book supports powerful automation capabilities for working with SharePoint sites, lists, and document libraries. This page provides end-to-end examples demonstrating how to use the Book’s procedures in an automation.

📝 Example 1: Employee Feedback Form

This automation demonstrates how to dynamically manage a SharePoint list for collecting employee feedback. It connects to a SharePoint site, creates a new list, adds a new column, and then simulates a form submission by creating a list item.

Manage an Employee Feedback Form
get sites from sharepoint whose name is "HR Resources"
use the first site as the site

create a list in the site
  the list name is "Employee Feedback Form"
use the above as the list

add a column to the list
  the name is "Satisfaction Score"
  the description is "Employee satisfaction rating from 1 to 5"
use the above as the column

retrieve column definitions from the list

create a json
use the above as the item body
set the item body's "Title" to "New Score"
set the item body's "Satisfaction Score" to "4"
add the item body to the list

get the list's items

The following procedures are used in this example:

Line #
Description
Procedure / Keyword

1

Gets sites from SharePoint with the name "HR Resources".

2

Sets the first site from the results to be designated as the site.

4-5

Create a SharePoint list with the name "Employee Feedback Form".

6

Sets the new list to be designated as the list.

8-10

Adds a new column to the SharePoint List.

11

Sets the new column to be designated as the column.

13

Retrieves the columns from the SharePoint List.

16

Sets the JSON to be designated as the item.

17-18

Sets values for the JSON.

19

Adds the item to the SharePoint List.

21

Get's the items from the list to check the new addition.

📝 Example 2: Bulk Deletion

This automation example demonstrates how to perform bulk deletion in SharePoint. It creates and populates a list with multiple items. Then, the list is filtered to identify all entries where the "My Col" column is set to "Value 1". These entries are then deleted in bulk, showcasing an efficient method for removing targeted data.

Get some sites from SharePoint whose name is "Testing"
use the first site as the site

create a list in the site
  the list name is "Item Deletion Example"
  
retrieve the site's lists whose name is "Item Deletion Example"
get the first list
use the first list as the list

add a column to the list
  the name is "My Col"

create a json
use the above as the first body
set the first body's "Title" to "First Item"
set the first body's "My Col" to "Value 1"
add the first body to the list

create a json
use the above as the second body
set the second body's "Title" to "First Item"
set the second body's "My Col" to "Value 1"
add the second body to the list

create a json
use the above as the third body
set the third body's "Title" to "First Item"
set the third body's "My Col" to "Value 2"
add the third body to the list

retrieve the list as a table

get the list as the slist
get the slist's items whose "My Col" is "Value 1"
use the above as the deletable items
delete the deletable items from the list

retrieve the list as a table

The following procedures are used in this example:

Line #
Description
Procedure / Keyword

1

Gets sites from SharePoint with the name "HR Resources".

2

Sets the first site from the results to be designated as the site.

4-5

Create a SharePoint list with the name "Items Deletion Example".

7

Retrieves SharePoint Lists from the site with the name "Item Deletion Example".

8

Gets the first list from the results.

9

Sets the first list as the list.

11-12

Adds a new column to the SharePoint List.

14, 20, 26

Creates a new JSON.

15, 21, 27

Sets the JSON to be designated as the first body, the second body, and the third body (respectively).

16-17, 22-23, 28-29

Sets values for the JSON.

18, 24, 30

Adds the first body, the second body, and the third body to the SharePoint List (respectively).

32

Retrieves the SharePoint List as a table.

34

Designates the SharePoint list as the slist

35

Gets specific items from the SharePoint List.

36

Marks the retrieved items as the deletable items

37

Deletes the items from the SharePoint list.

39

Retrieves the SharePoint List as a table.

Last updated

Was this helpful?