upload and process an excel file to create records
Application Type
Reactive
Service Studio Version
11.14.14 (Build 59923)

I manage to successfully upload an excel file to create records by following the Outsystem How to Youtube video https://www.youtube.com/watch?v=0NVHxmiPGDs, but when I try to upload a new excel sheet with the same entity and entity attributes the records doesn't get updated and remains same.

ExcelUpload_BootstrapOML.png

Hello Syed,

Attached oml contains required logic.

Excel template should be like this-

Demo Url for same - Demo

Demo6.oml

It worked!!!

Introducing Aggregate GetEmployeesByEmpId as per your OML did the trick. 

Thanks, Pramod.

Thanks, @Vinod Patidar and @Mayank Dharmpurikar for your valuable inputs.

It worked!!!

Introducing Aggregate GetEmployeesByEmpId as per your OML did the trick. 

Thanks, Pramod.

Thanks, @Vinod Patidar and @Mayank Dharmpurikar for your valuable inputs.

Hi Syed,

Use createorupdate() instead of create().

regards,

Pramod.

Thanks Pramod, I tried using createorupdate() still the records are not getting updated. 

Are you assigning ID's from excel or is it autoNumber?

Regards,

Pramod.

Hi Syed,

When you upload the excel file in entity then OutSystems created a Server action named as "Bootstrap{EntityName}". Please see the below screens. 

In this action If There is no records in entity then OutSystems Imported data from Excel to Entity. If data available in Entity then It does not Import data. 

You need to customize this server action as per your requirement. You need to remove if condition and Instead of CreateEmployee entity action you need to use CreateOrUpdateEmployee entity action.




Thanks

Vinod

Hi Vinod, 

Thanks for the reply.

In my case, I am uploading it from the upload widget , and I have already removed the GetPersons.list.Empty condition so that it directly starts with ConvertFromExcel since I am calling it from a File please see the attached screenshot. Maybe I am missing something...

ExcelUpload_BootstrapOML.png

HI Syed,

Please see the attached OML as per your requirements.

Thanks

Vinod

ExcelSample.oml

Movies - Copy.xlsx

Hi Syed,

After calling the bootstrap server action action, in the onchange event of upload widget just clear the upload widget with the following JS code(Use JS widget to do this)


var parent = document.getElementById($parameters.ElementId); 

var children = parent.children[0]; 

children.value = '';


ElementId you have to pass as Input parameter.

Hello Syed,

Attached oml contains required logic.

Excel template should be like this-

Demo Url for same - Demo

Demo6.oml

It worked!!!

Introducing Aggregate GetEmployeesByEmpId as per your OML did the trick. 

Thanks, Pramod.

Thanks, @Vinod Patidar and @Mayank Dharmpurikar for your valuable inputs.

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