Import Data From Single Excel File to Multiple Entities

Hi,


Thank you for reading this post. The logic I have created for "Importing Data from Excel" seem to be incorrect. May I ask for assistance on this little project I'm doing? 


BASICALLY:

1. I have an excel file that I want to import. Here is the structure below.

2. The Data model is this. The [Name] column is to be stored into an entity called Students while the [Subjects] column is to be stored into another entity called StudentSubjects.

3. THE PROBLEM; my logic doesn't seem to store/import all the subjects (Science, History, Math, Health) into the StudentSubject entity. I used String_Split action to split (",") the [Subject] column from the excel file.

When I import the excel, THE OUTCOME is that only one subject is created on the StudentSubject entity.


I have attached the .oml file and the excel file I used as a test for importing for your review.


Thank you and best regards,

Jane

Hey Jane, Happy to help you here...

What you need to do is, just after the String_Split, loop its result, and than do the Get/Assign/Create StudentSubjects objects.

Hope it's clear now.. ;)

João Melo wrote:

Hey Jane, Happy to help you here...

What you need to do is, just after the String_Split, loop its result, and than do the Get/Assign/Create StudentSubjects objects.

Hope it's clear now.. ;)

Hi Mr. João,


Thank you for taking the time to answer my question but I'm afraid I don't follow. I'm new to Outsystems and can't seem to understand the logic you want me to do. Can you please explain more clearly?


Thank you and best regards,

Jane



Sure... See oml attached and image bellow...

João Melo wrote:

Sure... See oml attached and image bellow...

Dear Joao,

Wouldn't having two different aggregates in For-Each loops have performance implications (perhaps not super important in this case, it's more a general question of design). The reason I am asking is that I have a very similar situation and solved it through first extracting the lists through aggregates, filter the lists in each iteration based on current parent value and then (sub-)iterate on the filtered lists (..and so on). Is filter list slower or faster than getting a new aggregate? I am currently on personal environment so using cache is not an option and could potentially affect design choice in an enterprise scenario.

I am sorry if this off topic (I don't know how narrowly this is defines around here). If it is, I can start a new thread with a link back instead.


Thanks!