cancel
Showing results for 
Search instead for 
Did you mean: 

Upload CSV file in CAP JAVA, Validate rows and return a List/ArrayList

DC
Explorer
576

Hi Team,

We have a requirement where we need to upload a CVS file then

  1. Validate file and content for each row. At this stage, NO DB activity needs to happen
  2. Return a List to UI for further UI activities - we want to show users the CVS file contents in a table with values populated and any errors regarding the line shown in a column
  3. Once user is happy, we will present a button to insert into DB 

I have looked at the samples but struggling to return the list to the UI/ caller.

If anyone have some ideas, please free free to share 🙂

Please let me know if you need more information.

 

@skymu89 

Cheers

D

 

 

 

View Entire Topic
skymu89
Product and Topic Expert
Product and Topic Expert

Hello,

CAP Java provided Media Type Processing support

https://cap.cloud.sap/docs/java/cds-data#mediatypeprocessing

https://cap.cloud.sap/docs/java/cds-data#media-upload-1

which process inputstream in the backend, you need implement other parts with custom code.

This one maybe more match your use case https://spreadsheet-importer.com/

Best regards, Sky

Marian_Zeis
Active Contributor
0 Kudos
Thank you @skymu89 for mentioning my open source project!