Forum Discussion

Undenius's avatar
Undenius
Copper Contributor
Nov 10, 2022
Solved

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

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'])
  • Undenius 

    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)

  • MarcelLehmann's avatar
    MarcelLehmann
    Copper Contributor

    Undenius 

    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)

    • Undenius's avatar
      Undenius
      Copper Contributor

      MarcelLehmann

       

      I worked to delete first and then add attachement.

      You just made my day 👍

Resources