Create new file names and delete old attached file to SharePoint list item

New Contributor

Hi Guys,

I am trying to creat a flow where I want Flow to rename attached files to a new filename using the column name. What works without any problem.
But I would alos like to delete the old files and only keep the new once.
What happens is that the flow create new files and also delete them my flow deletes the newly created file and keep the old once.
What am I doing wrong.

concat(triggerOutputs()?['body/Title'],' - ',triggerOutputs()?['body/Datum'],' - ',items('Apply_to_each')?['DisplayName'])
2 Replies
best response confirmed by Undenius (New Contributor)


I would say and test, delete before create the new one.
if this doesn't work, then i would save the filecontents in a variable (append to array), let the apply to each delete everything and later in a second apply to each let create everything from the variable (from the first apply to each)



I worked to delete first and then add attachement.

You just made my day :thumbs_up: