216
Views
9
Comments
Solved
Import Excel for two Entities with relatioship
Question

Hi Experts,


How can i implement on Importing/upload an excel on a two entities with relationship identifier.


Thanks and Best Regards.

2019-05-22 11-30-09
Marcelo Ferreira
Solution

Hi Joshua,

Changed your code a bit. Look the attached OML.

Regards,

Marcelo

DemoWebApp.oml
UserImage.jpg
Jay-jay

Marcelo Ferreira wrote:

Hi Joshua,

Changed your code a bit. Look the attached OML.

Regards,

Marcelo


Hi Marcelo,


Thank you for your reply. 

i gained new knowledge. ^_^


Thanks and Best Regards

2021-07-19 14-21-08
Carlos Alfradique

joshua aquino wrote:

Hi Experts,


How can i implement on Importing/upload an excel on a two entities with relationship identifier.


Thanks and Best Regards.

Hi there Joshua.

You can use the "ExcelToRecordList" and after use "for each" for create record by record.

But before, you need create a struct with your columns equal of excel.

Regards.

Carlos Alfradique


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Joshua,

How is the relationship defined in the Excel file? Is it through an Identifier? Is this Identifier an auto number in the target data model?


UserImage.jpg
Jay-jay

Kilian Hekhuis wrote:

Hi Joshua,

How is the relationship defined in the Excel file? Is it through an Identifier? Is this Identifier an auto number in the target data model?


Thanks for you reply

Hi Carlos,

Yes i am using the widget to upload into my entity. However what I'm trying to accomplish is to upload it that the entities that have a relationship. 


Hi Kilian,

It is through identifier and auto number.


I have attached my sample OML.




DemoWebApp.oml
2021-07-19 14-21-08
Carlos Alfradique

joshua aquino wrote:

Kilian Hekhuis wrote:

Hi Joshua,

How is the relationship defined in the Excel file? Is it through an Identifier? Is this Identifier an auto number in the target data model?


Thanks for you reply

Hi Carlos,

Yes i am using the widget to upload into my entity. However what I'm trying to accomplish is to upload it that the entities that have a relationship. 


Hi Kilian,

It is through identifier and auto number.


I have attached my sample OML.




Hi Joshua.

You need include one assign after the createOrUpdate User List.


Because you need the id of OutSystems.


Regards.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

In addition to the solution to your problem that Carlos already gave, some observations about the code:

  1. "UserList" is a strange name for an Entity. There's no "List" involved here. You should pick names that make sense.
  2. The Assign isn't named (always a bad thing), but inside it, you are assigning all the fields individually. Personally I'd just assign the records and set Id to NullIdentifier() for easier reading.
  3. You're using a "create or update", but you are always creating records (since the Id is NullIdentifier()). In that case, it's faster to use a "create".


UserImage.jpg
Jay-jay

Hi @Kilian thanks for your observation and suggestions.

Hi @Carlos thanks for your suggestion.

I have already use your suggestion prior however it is not working for me.


I have attached my OML.

DemoWebApp.oml
2019-05-22 11-30-09
Marcelo Ferreira
Solution

Hi Joshua,

Changed your code a bit. Look the attached OML.

Regards,

Marcelo

DemoWebApp.oml
UserImage.jpg
Jay-jay

Marcelo Ferreira wrote:

Hi Joshua,

Changed your code a bit. Look the attached OML.

Regards,

Marcelo


Hi Marcelo,


Thank you for your reply. 

i gained new knowledge. ^_^


Thanks and Best Regards

UserImage.jpg
Arun Hosur

But the above oml is for traditional module, How i can implement this in reactive module?

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