Read CSV file in ARAS in ClientSide/Javascript

Hello mates, I have a clumsy day today. I am trying to read an excel file, I have read that it could not be done, so I will try it with a CSV file.

I've looked all over the forum and Google, but I can't find the key to make it work for me.

In this forum I have seen several similar questions, but I have tried all the codes posted and they do not work for me.

One of the codes I tried is this:

var vault = top.aras.vault;
var fileName = vault.SelectFile();
var fileContents = vault.ReadText(fileName);

But it returns the value:

[object Promise]

I have seen by google that the solution is:

var promise = Promise.resolve(fileContents);

But it returns the same.

I have tried several examples from googe, but nothing. there is no way.
The PDFs of the documentation do not contain anything about it.

If it already gives me problems to load the file, I don't even want to imagine when "interpreting" the data.

Thank you so much!!.

  • OK!!!, i do it!. Works halfway!!!.

    I dont know why the code stops in the line 16.

    This code is similar to a post from Lucas. 2 years ago, and he did the same, he created a for and went through it with a rows.Length().
    In my case he does not get to execute that line of code. It stops before, if no error.

    function (fileObject){
        file = fileObject;
        alert("Filename:" +;
        var reader = new FileReader();
        // here we tell the reader what to do when it's done reading...
        reader.onload = readerEvent => {
            var content =; // this is the content!
            alert("Contenido:" + content );
            var rows =content.split("\n");
            alert("registros: ");
            alert(rows[1]);   // the code stops here!!!!
            var i;
            for (i = 0; i < rows.length(); i++){
                alert("Entra en el FOR");    
                var parts_to_add =rows[i].split(";");

  • Nothing, its work fine, its not rows.length(), the correct is rows.length.