5
Views
5
Comments
AE.2. Implement the Logic to Import Data
Question
Hi everyone!

So I finally made it to the second extra exercise. Now I have to implement my logic for the upload of the excel file. But I've got a problem....

I can't seem to check if a record from the excel file is already in the existing data, so now when I upload a new file it just adds it to the rest and it will create a duplicate. Completely ignoring my checkbox as well! I wonder what I'm doing wrong, if you are kind enough to help me out: check the attachments for my application. Inlcuding some test excel files, one of which has new records and an existing one (called: Cram).

Kind regards, Brandon
Test_Excel_SoftwareComputers.zip
2012-03-02 13-17-21
Paulo Ramos
Staff
Hi Brandon,

Sorry for the late reply. As you wrote, you have to check if the record already exists in the database. For this, add an Aggregate to the loop (inside the Import action). Your aggregate should search for an existing Software having the same name as the current excel row.

Hope this points you in the right direction, but feel free to ask further questions.
2018-11-06 15-50-22
Brandon Hop
Paulo Ramos wrote:
Hi Brandon,

Sorry for the late reply. As you wrote, you have to check if the record already exists in the database. For this, add an Aggregate to the loop (inside the Import action). Your aggregate should search for an existing Software having the same name as the current excel row.

Hope this points you in the right direction, but feel free to ask further questions.
 I just tried it and it worked, thanks for the help! After that I had the issue that it added the records which were new, even though there were records which were already existing (overwrite not selected). To solve this I added the records to a list first and if there was a record already existing it ended the flow. When it continued the flow another ForEach took care of the list and adds or updates them.

Thank you for your help once again!
 
2018-11-06 15-50-22
Brandon Hop
Hi Paulo, I wasn't expecting a quick reply since the course was already closed, so I'm glad I still got one. Thank you for your suggestion, I will try it immediately!
2018-12-05 19-23-29
Mart Potter
for every other assignement there is a solution in the end for download, where is solution for AE.2?
2020-10-15 10-24-31
Miguel Seabra Melo
Hi Mart,

It's a fair point... we don't seem to have one. :( We'll try and knock together one to put it up for download by the end of the week.

Thanks for the heads up,

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