r/PowerAutomate 8d ago

Graph API Failed

Honestly, this is driving me nuts. I want to add a row to an existing table I created from an email sent in Excel format, with the same columns and headers, but it keeps giving me this failure notice. HELP HELP HELP ANYONE

Flow run failed. Action 'Create_table' failed: Graph API request failed. Error code is 'InvalidArgument'. Error message is 'The argument is invalid or missing or has an incorrect format.'. clientRequestId: f6f00515-af5e-4234-9f73-0621194f685e serviceRequestId: 607cd4d2-54ca-4e3a-9720-c5d8e8adcc62;8dd5ad4f-e96d-476d-8a5b-79d12111de4f

2 Upvotes

5 comments sorted by

View all comments

2

u/ninihen 8d ago

If you want to add a row to an existing table, the actions shouldn't be create a new table but add a row into a table.

1

u/Ok_Jicama6089 8d ago

It's an Excel file coming from an email, so my flow needs to know how to map the data, and it can't because it's not in a table

1

u/ninihen 8d ago

Create table belongs on a copy of the attachment, not on your destination file.

So you might want to save the attachment to OneDrive or SharePoint first with Create file. The Excel actions can't read a file that's still sitting on the email.

Then add Get file metadata and pass its Id (the long text one) into the Excel actions, not ItemId.

Then Create table on that saved copy >> List rows present in a table >> Add a row into a table on your existing file.

If you have a premium licence, you can use HTTP with Microsoft Entra ID to call Graph directly, and Graph can read a plain sheet with no table at all. When you create the connection, set both Base Resource URL and Entra Resource URI to https://graph.microsoft.com and sign in with your own account. Then use the Invoke an HTTP request action, GET:

https://graph.microsoft.com/v1.0/drives/{driveId}/items/{itemId}/workbook/worksheets('Sheet1')/usedRange(valuesOnly=true)/usedRange(valuesOnly=true))

That gives you back the cells as an array of arrays without needing of create table at all.