Hi,

I have an excell bootsrapp importing from a struture,with this values

-target

-app

-appdesc

-data

but the problem is, my target is a one-to-many  relashionship and i need to import 1 or more (app and appdesc) at the some time!

Can someone help me please



Solution

Hi João,

You have a one-to-many relationship between what data exactly?

In general, when you have a 1:n relationship between A and B, and you have an Excel like this:

A  B
1  1
1  2
1  3
2  4
2  5

You would, when For Each-ing over the List from the ExcelToRecordList, query the database if you already have an A record, and if so, skip making a new one. Alternatively, if it's a lot of data and querying would be (too) slow, you could use a hash table (see Forge components).

Solution

Kilian Hekhuis wrote:


Between Target and  app/appdesc

1 TARGET have N App and N AppDesc


Hi João,

You have a one-to-many relationship between what data exactly?

In general, when you have a 1:n relationship between A and B, and you have an Excel like this:

A  B
1  1
1  2
1  3
2  4
2  5

You would, when For Each-ing over the List from the ExcelToRecordList, query the database if you already have an A record, and if so, skip making a new one. Alternatively, if it's a lot of data and querying would be (too) slow, you could use a hash table (see Forge components).



Well, then what I wrote will work. Test for Targets whether they already exist, if not create, otherwise skip.

Kilian Hekhuis wrote:

I didnt understand what is the way of complete the task. Can you be more precise im a begginer in outsystems!

Well, then what I wrote will work. Test for Targets whether they already exist, if not create, otherwise skip.



Hi João,

This is more basic programming than specifically OutSystems. I don't think I can be more clear than I was in my first post. Perhaps you have colleagues that you can ask for help?