Export data from CSV file and Import in to Read only grid

Certified Senior Developer

Hi 

I am working on the scenario in which I am using the milestone component.

Step 1, Uploading CSV file through the file upload component then click the next button of the milestone component.

In Step 2 I want to fetch data from a CSV file and want to show it on a read-only grid.

So If anyone knows how to fetch data from a CSV file and upload it to a read-only grid please let me know.

Many Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi,

    It depends on your approach.

    1. If you want to dump data into database, You can use "Import csv to database" smart service and then display into grid by a!queryEntity.

    2. If you are saving the file into your environment, You can use "previewcsvforimport()" as:

    previewcsvforimport(
    document: todocument(ri!documentId),
    delimiter: ",",
    charset : "UTF-8",
    numberOfRows: ri!numberOfRows
    )

    3. If you are using the csv text, then this should work:

    a!forEach(
    items: split(ri!csvText,char(10)),
    expression: split(fv!item,",")
    )

Reply
  • 0
    Certified Senior Developer

    Hi,

    It depends on your approach.

    1. If you want to dump data into database, You can use "Import csv to database" smart service and then display into grid by a!queryEntity.

    2. If you are saving the file into your environment, You can use "previewcsvforimport()" as:

    previewcsvforimport(
    document: todocument(ri!documentId),
    delimiter: ",",
    charset : "UTF-8",
    numberOfRows: ri!numberOfRows
    )

    3. If you are using the csv text, then this should work:

    a!forEach(
    items: split(ri!csvText,char(10)),
    expression: split(fv!item,",")
    )

Children