Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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,
  • BernaT Profile Picture
    2 on at
    Re: Script to convert csv to xlsx stopped working

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,601 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,942 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow