SharePoint — Update list item
SharePoint — Update list item
Section titled “SharePoint — Update list item”Type: msfiles-update-list-item · Package: OneDrive / SharePoint v1.0.5
Updates the fields of an existing SharePoint list item. It only changes the columns you give; the rest keep their value.
How it works
Section titled “How it works”It works on the session created with OneDrive/SharePoint — Connect. Pass it in the session parameter, or place this activity inside the body of Connect to inherit it automatically.
Values follow the same rules as in Add list item (dates in ISO 8601, people and lookups through <Column>LookupId). null values are skipped, so they do not empty the column; to leave a text column empty, send "".
Applying the same values twice gives the same result, so it is safe to retry. SharePoint records every change as a new item version, with the connection’s account as author.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
list | string | — | Display name or ID of the list. |
itemId | string | — | List item ID. |
fields | Dictionary | — | Values to update as { column: value }, with internal names. Must have at least one non-null value. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanMicrosoftFilesSession | — | Connect session. Inherited inside Connect’s body. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
No OneDrive/SharePoint session available. Provide 'session' from an msfiles-connect activity, or place this activity inside the Connect activity's body so the session is inherited automatically. | The activity is outside Connect’s body and did not receive session. Place it inside the body or pass session = session. |
This activity needs a SharePoint site. Set 'siteId' in the Connect activity. | Connect was opened without siteId. |
'list' is required. / 'itemId' is required. | The parameter is empty or its expression returned null. |
'fields' is required. | fields is empty, all its values are null or it is not a dictionary. |
itemNotFound (Microsoft Graph, 404) | The list does not exist, or there is no item with that itemId (it may have been deleted). |
invalidRequest (Microsoft Graph, 400) | A column does not exist with that internal name, or a value does not have the expected format. |
Example
Section titled “Example”OneDrive/SharePoint — Connect credential = credential("m365-operations") siteId = siteId └─ body: SharePoint — Update list item list = "Requests" itemId = request["id"] fields = { "Status": "Resolved", "ClosedDate": DateTime.UtcNow.ToString("o") }Related activities
Section titled “Related activities”- SharePoint — Get list items — locate the item and its ID.
- SharePoint — Add list item — add an item.
- SharePoint — Delete list item — delete an item.
- All OneDrive / SharePoint activities