Fix Power Automate Add a Row to Excel 504 BadGateway Error
Question details
A Power Automate flow that transfers Microsoft Forms responses to an Excel table fails with a 504 BadGateway error because the Graph API request times out.
- Product
- Power Automate, Microsoft Excel
- Device & OS
- not provided
- Scenario
- Transferring collected Microsoft Forms responses to an Excel spreadsheet table using an automated flow.
- Observed behavior
- The flow execution fails at the 'Add a row into a table' step, returning a 504 BadGateway error due to a Graph API timeout.
Verify that your target Excel file is stored in a supported cloud location (OneDrive for Business or SharePoint) and ensure no other users are actively editing or locking the workbook in the desktop app.
Verify File Hosting and Table Formatting
Ensure the Excel file is correctly hosted in the cloud and the destination is formatted as an official Excel Table.
Power Automate relies on the Microsoft Graph API to interact with Excel files. The API requires the file to be stored in the Microsoft 365 cloud ecosystem and strictly requires the destination data range to be formatted as an official Table, not just plain cells.
Move your Excel file to OneDrive for Business or a SharePoint Online document library if it is currently stored locally.
Open the Excel file, select the range of cells where you want the Form responses to go, and press Ctrl+T (or go to Insert > Table). Ensure 'My table has headers' is checked.
Ensure the file is not currently open in the Excel desktop application by you or another user, as this can place a temporary lock on the file, causing API requests to time out.
Optimize Flow to Reduce Concurrent Operations
Prevent Graph API timeouts by reducing the load and spreading out bulk updates in your flow.
Consult the Power Platform Community
Seek advanced troubleshooting support by providing detailed error logs to Power Automate experts.
Manage Your Spreadsheet Data Smoothly with WPS Office
While cloud-based automation tools like Power Automate are great for data collection, managing and analyzing that data locally shouldn't require expensive software. WPS Office provides a free, lightweight, and fast alternative to Microsoft Office, ensuring seamless compatibility with all your spreadsheet formats without heavy resource demands.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the installer and follow the simple on-screen prompts to set up the software in minutes.
- 3. Open Your Data: Launch WPS Spreadsheets and open your exported .xlsx files to instantly view, analyze, and format your data.

Frequently Asked Questions
Why does Power Automate throw a 504 BadGateway error when updating Excel?
A 504 BadGateway error typically occurs when the Microsoft Graph API times out. This happens if the target Excel file is locked by another user, the file is too large to process quickly, or too many concurrent requests are being sent to the server.
Do I need a specific table format in Excel for Power Automate to work?
Yes. The data range in your Excel workbook must be explicitly formatted as a Table (using Insert > Table) and stored in a cloud location like OneDrive or SharePoint. Power Automate cannot append rows to unstructured plain cells.
How can I prevent file lock issues causing API timeouts in Power Automate?
Ensure that users are not keeping the Excel file open in the desktop application while the flow is running. Furthermore, avoid having multiple flows trying to write to the exact same Excel file at the same time.
Can I use delay actions to fix Graph API timeouts?
Yes. Adding a 'Delay' action between operations in an 'Apply to each' loop can pace the request rate. This helps prevent Graph API throttling, which is a common cause of subsequent 504 BadGateway errors.




