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 / Script to convert csv ...
Power Automate
Unanswered

Script to convert csv to xlsx stopped working

(0) ShareShare
ReportReport
Posted on by 2

Hi,

I had a flow working perfectly, converting csv to xlsx but since last Thursday it stopped working.

The flow uses the following script (taken from Power GI youtube tutorial: https://www.youtube.com/watch?v=2TIolfmtWQM) that no longer works:

 
function main(workbook: ExcelScript.Workbook, linecsv: string[]) {
    let selectedSheet = workbook.getActiveWorksheet();

    const alllines = linecsv;
    let counter = 1;
    for (let line of alllines) {
        if (line.includes(",")) {
            let items = line.split(",");
            // Set range A1:B2 on selectedSheet
            selectedSheet.getRange("A" + counter + ":B" + counter).setValues([[items[0], items[1]]]);
            counter++;
        }
    }

    // Add a new table at range A1:B2 on selectedSheet
    workbook.addTable(selectedSheet.getRange("A1:B" + counter), true).setName("hoja1");
}

It runs, but it does not return anything other than a table with no data. It seems part of this code does not work since latest microsoft change on Thursday, whtever it was.
Thank you,
Categories:
I have the same question (0)
  • BernaT Profile Picture
    2 on at

    Nevermind, I used the microsoft published script code to convert csv to xlsx and it works fine:
    https://learn.microsoft.com/en-us/office/dev/scripts/resources/samples/convert-csv

    regards,

     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard