My Excel list get 2 column Student Name + Age.
My entity structure is ID + Student Name + Age + Other info
When import excel, the student name will the unique identifier to check to filter to check if the inserting record is already exists in the entity.
However, i follow the solution here: https://www.outsystems.com/forums/discussion/34123/updating-database-with-excel-to-record-list/
For c4), where i can get the excel.student.ID?
Hi,
Hope so, but you can see in the screenshot we have to do like that in the screenshot it will update not create your record.
Regards,
Rajat
Hi @Giselle Chen,
Student I'd will create automatically when you will insert new record in the DB because identifier is auto generated of any entity.
While in the assignment when you have same record already present in the DB and you are inserting that record again in the DB than it will update on that same Id.
In the aggregate you are comparing your excel value and DB name on the behalf of that it will you respected record id for update and if aggregate is empty at that time in the excel.student.id will assign null and at the time or create record it will automatically generate id.
Hope this will helps you!!!
hi @Rajat Agrawal, I have attached my apps file and importing excel, could guide me where im setting wrong and eventhough i put the for each loop, but system only can update 1 record.
I have change the code in your OML instead of doing end after empty we have to create our record in DB.
Please have a look in your OML.
Hope this helps you!!
Because the real scenario is the importing excel may have other student info, which we dont want to generate the new record. Hence, we only update the record which can map to the student name in excel, for the other extra student in excel, we no need to generate the new record.
Based on the above requirement, i end the loop when student list.empty = true. However, the whole process doesnt work.May i know where am think wrong/setting wrong, pls correct my following understanding:1.After filter the student aggregate, then check if student list.empty
2. if student list.empty = true, connect to end. means end the loop and not generate the new record.
3.if student list.empty = false, connect to dummy assign > CreateorUpdate Run server action to update the record.
ok, When list is empty and you don't want to create record than you can add your true branch with end operator.
While in the false branch you can add data for update record, but the condition is that we have records in the DB so we can check because no record will match than nothing will update in that part.
I changed OML please check now we have records in DB and we are uploading excel with same records than it will update in DB.
Thanks Rajat, but u OML is not working, it will not update the record.
Let me check it is working from my side.
Can you try this OML.
quite wired, it not working on my side, is it because of any setting from my part?
Hi Rajat, it works when looped back to for each when filter is true, thank you