I'm trying to create a flow that makes a file based on an email attachment, but the script for the flow isn't running correctly.
Here's the whole flow:
And this is the code fore the script if it's relevant:
function main(workbook: ExcelScript.Workbook,
TableName: string = "Table1",
SheetName: string = "Sheet1"
) {
// Get the worksheet by name
const selectedSheet = workbook.getWorksheet(SheetName);
// Create a table using the data range.
let newTable = workbook.addTable(selectedSheet.getUsedRange(), true);
newTable.setName(TableName);}
The error kickback reads:
We were unable to run the script. Please try again.
The script couldn't create a connection with Excel. Please try again.
clientRequestId: 55e50ca3-4761-4f64-9957-31a80ee13ad5
I'm pretty new to this so any help would be appreciated! Thanks!
I fixed it, so for all others... Here's my fix. I used Run from Sharepoint and I manually typed in the file name.
I created a flow that takes a excel email attachment, converts it to have tables, then converts it to CSV then uploads it to an Amazon S3 bucket. I am going to try to put up the whole flow on my tut website drupal girl. Hopefully the next couple weeks. Works busy 🙂
Hi there! When you say "output from 'get file properties' should be used in File in 'run script' action" what field is that? I tried what he did below but no love.
I used the file name with extension but no could still cannot get it to connect to excel. 😞
Apologies. I tried that, but the flow ended up timing out. However, I didn't have an option for outputs in the run script section so that might have affected the result. Here's how my flow looks now
No no. What the point I am trying to make is:
'item id' from create file action should be used in ' get file properties' action and output from 'get file properties' should be used in File in 'run script' action
I don't believe so. The flow is creating a new file to run the script in.
Dynamic content used in File in run script?
Same error 😕
@Abba Could you please try using 'Get file properties' action between 'create file' and 'Run script' and see it it works
@Ankesh_49 I tried adding a few different delays up to one minute, but the flow keeps erroring out at the script step after a few seconds.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492