web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Delete file part of flow issues

(0) ShareShare
ReportReport
Posted on by 8

Currently building a flow that:

  • creates an MS Team via an approval
  • Creates a temp file in the "Shared Documents/General" directory called "PleaseDelete.docx"
  • Copies folder structure from a "template site structure"
  • Deletes the "temp" file

All working as expected apart from the section to delete the temp file.

I use the "Get Files" action to locate the temp file but run into issues when I try and use the "Delete file" action. For the "Site Address" field I populate using the target sharepoint site which contains "TeamName" dynamic content which is the name of the newly created MS Team in the previous steps. For "File Identifier" I would expect to find the "Identifier" parameter from the "Get Files" dynamic content but I cannot see it anywhere. 

Obviously Im missing the vital concept here. Have posted the relevant flow grab below:

 

HRC_Neil_0-1648574802831.png

 

Thanks in advance!

 

N

I have the same question (0)
  • v-bofeng-msft Profile Picture
    on at
    Re: Delete file part of flow issues

    Hi @HRC_Neil :

    Please try this expression:

    items('Apply_to_each')?['{Identifier}']

    vbofengmsft_0-1648779395792.png

    Best Regards,

    Bof

     

  • Riyaz_riz11 Profile Picture
    3,844 Super User 2025 Season 2 on at
    Re: Delete file part of flow issues

    Hi , 

    You can try using this command in file Identifier.

    items('Apply_to_each')?['{Identifier}']

     

    Regards

    Ahammad Riyaz

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

     

    @HRC_Neil

  • HRC_Neil Profile Picture
    8 on at
    Re: Delete file part of flow issues

    Hey Bof, many thanks for the reply. Ok so extracted the "delete" part of the original flow into a separate flow for testing. The var "TestTeam36" refers to an existing Team with the test file to delete. Have added the expression as advised but get a 400 error regarding JSON format. Flow and error grabs below.

     

    Thanks!

    flow_grab_2022_04_01.jpgflow_grab_error_2022_04_01.jpg

     

  • HRC_Neil Profile Picture
    8 on at
    Re: Delete file part of flow issues

    Thanks for the reply Ahammad Riyaz. Bof had the same idea. Have replied above.

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Delete file part of flow issues

    Hi @HRC_Neil :

      You need to put the formula into the expression code bar:

    vbofengmsft_0-1648805045214.png

    Best Regards,

    Bof

     

  • HRC_Neil Profile Picture
    8 on at
    Re: Delete file part of flow issues

    What a plumb! Of course you do.

     

    Thanks Bof, tested and working!

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 532 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 461 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 256

Last 30 days Overall leaderboard