OneDrive/SharePoint — Close
OneDrive/SharePoint — Close
Section titled “OneDrive/SharePoint — Close”Type: msfiles-close · Package: OneDrive / SharePoint v1.0.5
Closes a OneDrive/SharePoint session and releases its resources. It is only needed when you opened the session with Connect without body.
How it works
Section titled “How it works”It works on the session created with OneDrive/SharePoint — Connect. Pass it in the session parameter.
If you used Connect with body, the session closes automatically when the block ends and you do not need this activity.
Closing the session changes nothing in OneDrive or SharePoint: every earlier operation was applied when it happened. After closing, the session variable can no longer be used by other activities.
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanMicrosoftFilesSession | — | Connect session to close. 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. | You did not pass session and the activity is not inside Connect’s body. Pass the variable returned by Connect. |
Apart from that case, the activity does not fail: it makes no calls to Microsoft 365.
Example
Section titled “Example”OneDrive/SharePoint — Connect credential = credential("m365-operations") → output: sessionOneDrive/SharePoint — Upload session = session path = "C:\reports\today.pdf" destination = "Reports/today.pdf"OneDrive/SharePoint — Close session = sessionTo close the session even if an activity in between fails, put Close in the finally of a Try / Catch, or use Connect with body, which does it for you.
Related activities
Section titled “Related activities”- OneDrive/SharePoint — Connect — open the session.
- All OneDrive / SharePoint activities