-
-
Notifications
You must be signed in to change notification settings - Fork 370
Expand file tree
/
Copy pathcreate_text.py
More file actions
24 lines (20 loc) · 628 Bytes
/
create_text.py
File metadata and controls
24 lines (20 loc) · 628 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Create a Text column in a list
https://learn.microsoft.com/en-us/graph/api/list-post-columns?view=graph-rest-1.0
"""
from office365.graph_client import GraphClient
from tests import (
create_unique_name,
test_client_id,
test_password,
test_tenant,
test_username,
)
client = GraphClient(tenant=test_tenant).with_username_and_password(
test_client_id, test_username, test_password
)
lib = client.sites.root.lists["Documents"]
column_name = create_unique_name("TextColumn")
column = lib.columns.add_text(column_name).execute_query()
print(column.display_name)
column.delete_object().execute_query()