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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / BadRequest when trying...
Power Automate
Answered

BadRequest when trying to replace old file to new one

(0) ShareShare
ReportReport
Posted on by 111

Hi, I am new to Power Automate and I was given this project to debug but previous it just shown infinite loop when sending a message but I able to solve that problem (I hope). Recently, one of the employees approved a document to replace the old one and the error shown as below.

 

Explaination for the flow:

  1. The flow starts with a trigger that gets the updated items from a SharePoint list. Then, it retrieves items from the same SharePoint list based on specific conditions.
  2. Next, it initializes some variables and an array to store attachments.
  3. Inside a loop, it gets the attachments for each item and stores them in the array. If the document type is "Procedure", it creates a file in a specific folder and updates its properties. Otherwise, it creates a file in a different folder and updates its properties.
  4. After that, it retrieves the process and document type for each item. If the document type is "Procedure" and there are existing items in another SharePoint list with the same process, it deletes the attachments, adds the new attachment, and updates the item properties. If there are no existing items, it creates a new item and adds the attachment.
  5. If the document type is "Policy", it follows a similar process as above but with a different SharePoint list.
  6. If the document type is "Guideline", it follows a similar process as above but with another SharePoint list.
  7. If the document type is neither "Procedure", "Policy", nor "Guideline", it sends a message to a Microsoft Teams channel.
  8. Finally, it updates the items in the SharePoint list and sends a message to the Microsoft Teams channel.

 

My problem is also similar to this thread: BadRequest in Power Automate while the attachment is uploaded to Sharepoint 

 

Thank you!

image.pngimage.png

Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @azni ,

    The flow error message prompts you that this file has already been created.

    Because when you use the When an item is created or modified trigger, as long as the item is created or modified, its documentType is assumed to be Procedure, and the attachments contained in this item will be created in the specified folder. All items that are Procedure, they are containing attachments will be created in the specified folder. This is why flow reports that the file name already exists.

     

    Best Regards,

    Sunshine Gu

     

  • azni Profile Picture
    111 on at

    Hi, Sunshine Gu. Does that mean I need to recreate the flow (from the error starts) with different triggers and actions as this system is to let the manager to check the file request (by employees), edit them, approve then publish to SharePoint list. TQ.

  • Verified answer
    azni Profile Picture
    111 on at

    I solved the problem by disabled the 'Allow chunking' for action 'Create item'

    image.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard