Share File Or Folder
Description
Share File Or Folder step shares the file or folder from the Document Library present in a specified site in SharePoint Online.
API Reference:
- https://docs.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http
- https://docs.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-1.0&tabs=http
Prerequisites
You require the following permissions for app on Azure:
Permission type | Permission (from least to most privileged) |
---|---|
Delegated (work or school account) | Files.ReadWrite, Files.ReadWrite.All, Sites.ReadWrite.All |
Delegated (personal Microsoft account) | Files.ReadWrite, Files.ReadWrite.All |
Application | Files.ReadWrite.All, Sites.ReadWrite.All |
Configuration
No. | Field Name | Description |
---|---|---|
1 | Step Name | Specify the name of the step. This name must be unique within a single workflow. This is a mandatory step. |
Connection: | ||
2 | Client ID | Specify the Client ID of the SharePoint App. For information on creating a client ID, see Appendix: SharePoint: App Registration & Refresh Token Generation. The field data type is String. This is a mandatory field. |
3 | Accept value as variable/static | Select the checkbox if you want to enter the Refresh Token name in the Refresh Token field. If you do not select the checkbox, you can select the refresh token in the Refresh Token field. |
4 | Refresh Token | Specify or select the Refresh Token generated using the ClientID, which is created after registering the App in Azure AD. This is a mandatory field. |
5 | Test Connection | Verifies whether the connection is established or not.Note: This connection will not work for the previous step variables. The button will only work with static values and environment variables. |
Input Tab
No. | Field Name | Description |
---|---|---|
Input Fields: | ||
1 | Base Site URL | Specify the SharePoint site-relative URL. {Tenant Name}.sharepoint.com:/ {Sharepoint Site Path} . Example: firstUser.sharepoint.com:/sites/TestingSite . This is a mandatory field. Note: For the root site (Communication Site), no need to provide the {sharepoint site path} . |
2 | Document Library Name | Provide the name of the SharePoint Document Library in which the search will be performed. This is a mandatory field. |
3 | File Or Folder Path | Provide a valid SharePoint file or folder path to share. This is a mandatory field. |
4 | Share Type | Specify the share type. Share type specifies the scope of the shareable link to be created. Allowed values: - Anyone : Anyone with the link has access, without needing to sign in. This may include people outside of your organization. - PeopleInDomain : Anyone signed into your organization (tenant) can use the link to get access. - SpecificPeople : Share only with people you choose inside or outside the organization. This is a mandatory field. Limitation: If the share type is SpecificPeople , the shareable link is not populated in the response when the link is opened. However, a notification email is sent to the email addresses provided in the field Share With Email Address. |
Sharing & Notification Tab: | ||
1 | Share With Email Address | Specify the property name on the basis of which you want to sort the result. Example: name . The above request sorts the SharePoint items by name . Note: The fields Sort On and Sorting Type work as a single parameter internally in the API call, so the user must provide Sort On if Sort Type is provided. |
2 | Send Invitation | Specify the option. If Yes , a sharing link is sent to the recipient. Otherwise, permission is granted directly without sending a notification. Allowed Values: Yes , No . Default Value: Yes . Note: The field is supported only for the SpecificPeople share type. |
3 | Require Sign In | Specify if the recipient of the invitation is required to sign in to view the shared item. Default Value: No . Note: The field is supported only for the SpecificPeople share type. |
4 | Message | Specify a plain text-formatted message to be included in the sharing invitation as the email body. |
Access & Link Security | ||
1 | Allow Editing | Specify Yes if edit access should be given to the sharable link, otherwise specify No for read-only access. Allowed Values: Yes , No . Default Value: No . |
2 | Expiration Date | Specify the date in the format YYYY/MM/dd after which the link expires. If not specified, the link will never expire. Note: The field is not supported for SpecificPeople . |
3 | Link Password | Specify the password for the sharing link. Note: This field is supported only for the Anyone share type. |
Output Tab
No. | Field Name | Description |
---|---|---|
Output Field: | ||
1 | Sharable Link | Specify a field to define the output variable name. The default output variable name is SharableLink . On successful execution, it holds the Shareable Link. |