Use Power Automate to create and share folders in SharePoint

preview_player
Показать описание
In this video, you'll see how to generate personalized folders to people in a SharePoint list and share each with the respective person. This is accomplished using an HTTP request to the SharePoint REST API. You'll also see a little JSON formatting magic to turn a text column into a clickable icon that takes users to each folder.

Important bits for the HTTP request (replace the parts in % % with your own values):

Uri:
_api/web/Lists/GetByTitle('%display-name-of-your-list-or-library%')/GetItemById('%ID-of-the-file-or-folder%')/ShareLink

Body:
{
   "request": {
       "createLink": true,
       "settings": {
           "linkKind": 6,
           "expiration": null,
           "role": 2,
           "restrictShareMembership": true,
           "updatePassword": false,
           "password": "",
           "scope": 2
       },
       "peoplePickerInput": "[{\"Key\":\"%email-address-to-share-with%\",\"IsResolved\":true}]"
   }
}

JSON formatting code:
{
"elmType": "div",
"style": {
   "display": "table",
   "width": "100%"
},
"children": [
   {
     "elmType": "a",
     "attributes": {
       "iconName": "DocumentSet",
       "class": "ms-fontColor-themePrimary",
       "target": "_blank",
     },
     "style": {
       "font-size": "30px",
       "text-align": "center",
       "vertical-align": "middle",
       "text-decoration": "none"
     }
   }
]
}
Рекомендации по теме
Комментарии
Автор

ARGH THANK i was looking for a solution for this for a couple of hours.

danielboi
Автор

@cvkealey Hi..Thank you for your help but I am getting some error in update flow. The error is Input parameter 'item/FolderCreated is required to be of type 'string/ date time'.

kirtichopra
Автор

Hey @cvkealey, thank you for the video.
Can you please tell me if this flow works for sharing a folder with external people, I mean people outside the organization. If so, how can I get a link to the folder to send it in an email to that external person?

etrkwdn