Cannot delete TaskFolder with the same name twice in Outlook Rest Tasks API - outlook-restapi

We are using the outlook tasks API to delete a TaskFolder.
If we create a folder and delete it all goes well. If we then create the folder again with the same name and then delete it again we get the following error when deleting:
409 (Conflict)
{"error":{"code":"ErrorFolderExists","message":"A folder with the specified name already exists."}}
This seems like a bug ?? It probably is moving it to an trashcan internally ? Also from the outlook.com site it does not work.

This is a known problem, and you're guess is correct. Essentially you're trying to copy a folder into the "Deleted Items" folder that has the same name as a folder that already exists there. The workaround here would be to rename the folder with some reasonably unique value (like maybe append a timestamp to the name), then delete it.

Related

Copy Sharepoint folder to local drive

I'm new to power automate and have been searching on Microsoft forums and googling a flow to copy all contents of a sharepoint root folder (Documents) to a local drive and cannot find an easy straight forward answer.
All i see is how to copy files to a local drive, which after trying and failing a lot, i finally found 1 flow that helped me do it in 2 steps:
1 - When a file is created;
2 - Create file
What i intend is to backup the root documents folder monthly with all other folder and files included to a local drive with power automate.
Appreciate any help.
Il post the prints on the flow i have right now:
Created Flow
Error after running flow
What happens is that one subfolder is selected and only the files on the subfolder are copied to the local drive, not the subfolder itself, and after that it stops the flow saying no dependent actions succeeded. I was expecting the following:
1 - Select files in folder and copy to chosen path;
2 - Select subfolders with files and create the same subfolders with files on the chosen path;
First you have to list all the files you need to copy to your Drive using the sharepoint Get Files action:
Next, add an Apply to each using the first dynamic content you have on the right side, normally it's a value like showed below, then add sharepoint action Get file content using path. Select the same root directory you used in the Get Files action and in the File Path property use the dynamic content Complete Path.
Next, all you have to do is create a new file using the Google Drive action Create File still inside the Apply to each. Use the file name and in File Contents use the dynamic content File contents:

Automatically create Subfolders on SharePoint Document Library

I have been trying to accomplish this for weeks now and end up hitting a wall.
I have a document library on SharePoint Online with the following (close enough) structure.
Clients
-> Schools
-->Client Name
--->Communications
--->Documentation
--->Projects
---->Project Name 1
---->Project Name 2
->Retail
-->Client Name
--->Communications
--->Documentation
--->Projects
---->Project Name 1
---->Project Name 2
... and so on.
Inside the "Projects" folder there is a set of folders as well.
Right now we have a Project template folder that we used to just copy/paste and rename when we had our file server, but now on SharePoint, the copy to process is way too many clicks to get it to that location.
What I am trying to accomplish is be able to create a new project folder and automatically create all the folders under it.
Appreciate the guidance on this.
I was able to figure this out.
My challenge was when creating the folder, it always wanted to create it inside the root of the document library and not the subfolder.
So I created 2 Content types for folders, one for clients and one for projects.
Used SharePoint Designer to create the workflow, but the trick here was to extract the URL from the current item, which is the folder being created, and remove the first x amount of characters from it which equals the SharePoint document library location. The remaining part of the string was the exact location where I wanted the subfolders to be created.
After that, I used that variable to create all other subfolders.

Check share point if file exists in a shared document folder with power automate

I am trying to get the attachments of some emails and check if that attachment already exists in SharePoint. However, since the flow may have already run over some attachments that have already been received, they may or may not already be in SharePoint, so I first have to check SharePoint if the attachment exists and if they don't, create the file using the email attachment content.
So what I have so far is replicating a process that was described here
The problem that quickly arises is that under "Get file content using path" action, the File Path input box(circled below) won't let me append a file path that isn't currently already in a document folder.
Not sure if this is still a valid way to accomplish it or if there's another way. I have checked all over the place and still haven't been able to find a solution. If there's anybody that can help it would be greatly appreciated!!
To tackle this what you can do is to create a variable using Initialize variable action and compose the path e.g. '/DocumentLibrary/file.ext' that you want to check if exists. then you can refer to that variable in your folder path box for Get file content using path action. Please see the screenshot:
Next you can configure run afterfor file creation action and create file if Get file content using path action has failed, otherwise do other stuff that is required. I have tested this for sending different emails based upon file found or not found and it works well.
Hope this solves your issue.

Delete folder by name from google drive using gdrive

I have read the documentation for gdrive here, but I couldn't find a way to do what I want to do. I want to write a bash script to upload automatically a specific folder from my hard drive. The problem is that when I upload it several times, instead of replacing the old folder by the new one, it generates a new folder with the same name.
I could only find the following partial solutions to my problem:
Use update to replace files. The problem with this partial solution is that new files inside the folder could not get uploaded automatically, and I would have to change the bash script every time a new file is produced in the folder that I want to upload.
Erase the folder by its id from google drive and then upload the folder again. The problem here is that whenever I do this, the id of the uploaded folder chagnes, so I couldn't find a way to write a script to do the work.
I am looking for any method that solves my problem. But the precise questions that could help me are:
Is there a way to delete a folder from google drive (using gdrive) by its name instead of by its id?
Is there a way to get the id of a folder by its name? I guess not, since there can be several folders with the same name (but different ids) uploaded. Or am I missing something?
Is there a way to do a recursive update to renew all files that are already inside the folder uploaded on google drive and in addition upload those that are not yet uploaded?
In case it is relevant, I am using Linux Mint 18.1.
Is there a way to delete a folder from google drive (using gdrive) by its name instead of by its id?
Nope. As your next question observes, there can be multiple such folders.
Is there a way to get the id of a folder by its name? I guess not, since there can be several folders with the same name (but different ids) uploaded. Or am I missing something?
You can get the ids (plural) of all folders with a given name.
gdrive list -q "name = 'My folder name' and mimeType='application/vnd.google-apps.folder' and trashed=false"
Is there a way to do a recursive update to renew all files that are already inside the folder uploaded on google drive and in addition upload those that are not yet uploaded?
Yes, but obviously not with a single command. You'll need to write a short script using gdrive list and parse (awk works well) the output.

sharepoint workflow to move files of a content type to new folder (after creating it if needed)

I have multiple SP document libraries for different meetings. I want to keep the libraries organized by meeting day. So each meeting would have it's own folder and all the files for that day would go in that folder.
To make it easy I wanted to make it so you can upload a file and then a SP workflow will create a folder for that meeting, if needed, and move the file.
So I created a "meeting file" content type that also gets meeting date and file type (minutes, presentation, misc, etc...)...
What I need to do next is check if a folder for that meeting date exists and create it if it does not. Then move the file over to that folder.
Any ideas how I could do this?
I could also try it without using content types but then the workflow starts automatically for every file added and then I cannot create a new folder with that workflow (because it would start a new instance of that workflow).
I was hoping to keep it reusable so I could just use one workflow for all the document libraries. I thought the workflow could find the path of the list it is being run on, and create the folders and do the other work within that list.
Any ideas are appreciated.
For creating folder via workflows:
Creating folders and sub-folders using SharePoint 2010 Designer Workflow
and for checking folder name:
Create a string workflow variable.
Now create a lookup for your folder and set the variable to the folder's title. Take a look here for some helpful information and usage guidelines when it comes to list folders.
The actions dependent of the existence of the folder have to be placed inside an if-statement
E.g. the if-statement should be like "if [variable] not equals [folder name]" if you want the actions only to be run when the folder does not exist
and here the whole tutorial that I found:
Create folders using a SPD workflow

Resources