How to get data or map structure from download excel file?
Application Type
Mobile, Reactive

I have a mobile project which can upload excel file (.xlsx) and then get data in each record of excel content to designed structure and map those data into a local entity to display a table data or save it into my on-premise database via designed API service.

I read many forum, but I don't know how to convert binary of uploaded excel file and get content data from it.

Does any one have solution for this problem?

Thank.

Solution

In upload widget, add one onChange client action. It will be called when any file get upload. In this client action will call a server action to get the records from binary.

Need to create a server action. In that server action you will pass the uploaded binary. Then in server action use method ExcelToRecordList to convert the excel binary to list of records. In this method you need to pass 2 values : 1. Uploaded binary 2. Structure definition ( create a structure of same type as there is data in excel).

Please let me know if it helps to resolve the issue.

Thank you very much, it works! I didn't know there was this widget.

Hi Pongsakorn,

Please find attached working sample oml and the upload data excel

Best Regards

Devendra


fileupload.zip

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.