Hello All,
I am trying to workout a flow which archvies a file and subsequently take some action like creating a new template and sending email to end users. The archining is scheduled to run at a specfic day/time of the week. All is working good, however there are instances where the archiving action happens when someone has the file opened in edit mode. This is a excel file in shared mode. Obvisouly the delete file action would fail as the file is locked.
There are 2 queries I have
1. Is there a way to force delete the file even if someone has it open ( I think that is not a possibility)
2. Becasue we will have an error and the workfail will fail, wanted some way to send an email to the end user who has it locked.
The message section in the error body from the "delete file" action below has the details of the email ID of the user who has the file locked. So the email needs to go to this ID along with the error message. Not the complete error body. It might be straight forwrad but am not very technical to get into the nitty gritty. To be clear, I am able to get the entire body into an email but want to limit that to just the actual message.
{
"status": 423,
"message": "The file \"https://YYYYYY.sharepoint.com/sites/DeliveryTeam/Shared Documents/Test/New EAMD Reporting-WSR Current Week .xlsx\" is locked for shared use by someone@yyy.com.\r\nclientRequestId: 74dc39b5-350d-4107-9173-51acb98a1651",
"source": "https://yyyyy.sharepoint.com/sites/DeliveryTeam/_api/web/GetFolderByServerRelativePath(decodedUrl=@p...'",
"errors": [
"-2147018894",
"Microsoft.SharePoint.SPException"
]
}
Solved! Go to Solution.
Hi @Leejoh_Mathew,
Do you want to extract the email address from the message section of Body content?
I have made a test on my side and please take a try with the following workaround:
indexOf(string(body('Delete_file')),'by')
Add a “Compose 2” action, Inputs set to following formula:
indexOf(string(body('Delete_file')),'.\r\nclientRequestId')
Add a “Compose 3” action, Inputs set to following formula:
sub(outputs('Compose_2'),add(outputs('Compose'),3))
Add a “Compose 4” action, Inputs set to following formula:
substring(string(body('Delete_file')),add(outputs('Compose'),3),outputs('Compose_3'))
Add a “Send an email” action, To field set to output of “Compose 4 ” action.
Image reference:
The flow works successfully as below:
Best regards,
Kris
Hi @Leejoh_Mathew,
Do you want to extract the email address from the message section of Body content?
I have made a test on my side and please take a try with the following workaround:
indexOf(string(body('Delete_file')),'by')
Add a “Compose 2” action, Inputs set to following formula:
indexOf(string(body('Delete_file')),'.\r\nclientRequestId')
Add a “Compose 3” action, Inputs set to following formula:
sub(outputs('Compose_2'),add(outputs('Compose'),3))
Add a “Compose 4” action, Inputs set to following formula:
substring(string(body('Delete_file')),add(outputs('Compose'),3),outputs('Compose_3'))
Add a “Send an email” action, To field set to output of “Compose 4 ” action.
Image reference:
The flow works successfully as below:
Best regards,
Kris
Kris - (@v-xida-msft)
You're very helpful on a number of posts I have been researching. The functions you're using to manipulate strings and outputs from actions...is there a good reference somewhere to review them? I understand them in the context you use them, but would love to look at a list to be less reliant on searching through posts, heh.
Thank you in advance!
Sam
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
12 | |
9 | |
7 | |
7 | |
7 |
User | Count |
---|---|
19 | |
18 | |
17 | |
10 | |
7 |