web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard