Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Validate an uploaded excel sheet
Can somebody guide on how to validate an uploaded excel sheet. Validations like empty cell, column values not as expected data type, etc.
How would you do it if Liferay wasn't part of the mix?
Haven't done that before. Looking for suggestions! That is part of my next sprint. Would be easy if got a little lead

You might be using Apache Poi for reading excel ?? If yes then you can check cell value you can refer below https://tutorial.techaltum.com/read-excel-data-with-Apache-POI.html
Mohammed's path is the one I'd use. Basically leverage POI to check everything you want to check for.
I'd have a method that knows how to validate a row, then I'd open the sheet and for each row that would be processed invoke the validation method for it.
I'd have a method that knows how to validate a row, then I'd open the sheet and for each row that would be processed invoke the validation method for it.
Thanks for the lead, Mohammad and David! I am now able to iterate through each cell value and validate accordingly!
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™