{"id":2468,"date":"2026-02-03T11:14:00","date_gmt":"2026-02-03T10:14:00","guid":{"rendered":"https:\/\/blog.kodono.info\/wordpress\/?p=2468"},"modified":"2026-02-03T11:27:09","modified_gmt":"2026-02-03T10:27:09","slug":"power-automate-flow-force-a-file-deletion-and-replacement","status":"publish","type":"post","link":"https:\/\/blog.kodono.info\/wordpress\/2026\/02\/03\/power-automate-flow-force-a-file-deletion-and-replacement\/","title":{"rendered":"Power Automate Flow: force a file deletion and force a file replacement"},"content":{"rendered":"<p>To force a file to be deleted in a SharePoint Document Library, using a Power Automate Flow, we can call the action &#8220;<strong>Send an HTTP Request to SharePoint<\/strong>&#8220;, with the below:<\/p>\n<ul>\n<li>Method: <strong>POST<\/strong><\/li>\n<li>Uri: <strong>_api\/web\/Lists\/GetByTitle(&#8216;Document Library Name&#8217;)\/GetItemById(@{variables(&#8216;ItemID&#8217;)})\/recycle<\/strong><\/li>\n<li>Headers: <strong>Prefer: bypass-shared-lock<\/strong><\/li>\n<\/ul>\n<p>To force a file to be replaced with new content in a SharePoint Document Library, using a Power Automate Flow, we can call the action &#8220;<strong>Send an HTTP Request to SharePoint<\/strong>&#8220;, with the below:<\/p>\n<ul>\n<li>Method: <strong>POST<\/strong><\/li>\n<li>Uri: <strong>_api\/web\/GetFolderByServerRelativeUrl(&#8216;\/sites\/SiteCollectionName\/SubWebSiteName\/&#8217;)\/Files\/add(url=&#8217;DestinationFileName.csv&#8217;,overwrite=true)<\/strong><\/li>\n<li>Headers: <strong>Accept: application\/json;odata=nometadata<\/strong> and <strong>Content-Type: application\/json;odata=nometadata<\/strong><\/li>\n<li>Body: <em>whatever body\/content you want<\/em><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>To force a file to be deleted in a SharePoint Document Library, using a Power Automate Flow, we can call the action &#8220;Send an HTTP Request to SharePoint&#8220;, with the below: Method: POST Uri: _api\/web\/Lists\/GetByTitle(&#8216;Document Library Name&#8217;)\/GetItemById(@{variables(&#8216;ItemID&#8217;)})\/recycle Headers: Prefer: bypass-shared-lock To force a file to be replaced with new content in a SharePoint Document Library, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","hide_page_title":"","footnotes":""},"categories":[15,170,13],"tags":[153,152],"class_list":["post-2468","post","type-post","status-publish","format-standard","hentry","category-astuce","category-english","category-niveau-intermediaire","tag-astuce","tag-niveau-intermediaire"],"_links":{"self":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/comments?post=2468"}],"version-history":[{"count":3,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2468\/revisions"}],"predecessor-version":[{"id":2471,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2468\/revisions\/2471"}],"wp:attachment":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/media?parent=2468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/categories?post=2468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/tags?post=2468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}