Excel import Validation

Hi Team, I’m looking for validating the imported excel file.  For this, after importing the file successfully how exactly we need to retrieve the rows or objects  that got imported to order to validate?   If someone could brief that would be great!   Thanks in advance
2 answers

Hi Jhansi

    You need to create a duplicate the entity which you need to import the data and name as ExcelImport, Use ExcelImport Entity for importing Excel file and Retrieve the above entity and iterate and check for validations, once the validation passed create the object in your entity where you want the data and add to list and finally the commit the list outside the loop.


Kindly reply if any doubts ..


One approach could be to have a boolean attribute called something like isNew in the entity with a default value of true. When the data is imported this value will automatically be true. Once you've validated the data, set this value to false. So to look for the new data, just search for those objects with isNew set to true.


I hope this helps.