How to save additional fields (not present in the excel) during excel import ?

0
Hello, I am importing excel sheet having 3 columns. There could be multiple rows example 10.  I wish to link all the 10 records with same reference id, so while performing validation I can retrieve all the records uploaded using the reference Id. Example : Excel has 3 columns First Name Last Name Age But internally I wish to store 2 additional field  Reference Id : An Auto generated number same for all the records uploaded in one sheet. State : Uploaded   Once I have uploaded the records I wish to retrieve the list using the reference Id and perform validation and update the state accordingly i.e. Failed or Success depending on the state. Please guide how we can store this additional field using Excel-Importer    
asked
1 answers
1

Hi Abhishek,

Yes, this is possible although you do not have to store reference id’s for this. 

What you need to do is create a parent entity and associate it with the entity you are importing. One parent entity will be connected to “n” number of your entities. 

In your excel import configuration you can configure Reference to import objects as Parent entity and Mendix Object with your import entity. 

 

You need to create an instance of Parent Entity when starting an import and pass it on to StartImportByTemplate java action. Shown below:

 

What this will do is associate all the imported rows to the parent entity. Later in your microflow you can retrieve all the imported rows by retrieving them with association from parent entity. 

For status you can add an enumeration with a default value and set its appropriate value once its logic is executed. 

Hope this helps. 

Thanks,

Sharad R K

answered