logo
search
Microsoft 365 Error Codes

Fix Power Automate Add a Row to Excel 504 BadGateway Error

Maira MehtabMaira Mehtab Sep 28, 2026 871 views

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.
Before you start

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.

Solution 1Recommended

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.

1
Confirm Hosting Location

Move your Excel file to OneDrive for Business or a SharePoint Online document library if it is currently stored locally.

2
Format as Table

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.

3
Check Workbook Lock Status

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.

Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install WPS Office: Run the installer and follow the simple on-screen prompts to set up the software in minutes.
  3. 3. Open Your Data: Launch WPS Spreadsheets and open your exported .xlsx files to instantly view, analyze, and format your data.
100% compatible with Microsoft Excel formats (.xlsx, .csv, .xls)Lightweight architecture ensures fast load times even on older devicesFamiliar ribbon interface requires zero learning curveFree built-in PDF tools and local file management capabilities
QA img-9

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.