Import Set from UI Action

Blair5
Tera Guru

I have a requirement to allow the help desk administrator to upload a spreadsheet and import it into a specific table using a UI action. Basically, they click on a button called "Batch Add" and an attachment pop up appears, when they click attach and close, the file is uploaded. Has anyone else done something similar with a UI action?

10 REPLIES 10

Aaron40
Kilo Guru

At first thought it might be easier to grant permission for your service desk to add files to a super secret spot on a server somewhere and create a data source that pulls from that feed. Have your service desk put their file on the server and have a UI action kick off the event that triggers the data pull. That seems like it'd be quicker to implement to me since you won't need to create a custom interface to allow attachments.


VamsiKommireddi
Kilo Contributor

Create a data source,transform maps,transform scripts(If required) to load the data into target tables.

Add a UI Action to load the attachment data of excel to the record ie it internally inserts a new record on to 'sys_attachment' table.Write Business rule on sys_attachment which will kikk of in case the file name is matching(ie always we need to keep the file name constant).Copy this attachment record as a data source of source file and start the data transformation programatically.

Invoking Data Load:
Packages.com.glide.ui.SysAttachment.copy(this._tableName,this._tableRcdSysId,'sys_data_source',dataExtractRcd.data_source);
Packages.com.snc.automation.TriggerSynchronizer.executeNow(dataExtractRcd);

After data transformation is complete delete to attachments from both source record and data source to avoid piling up of attachments and next user can set his data source as source to dataload.

Thanks,
Vamsi Kommireddi,
Certified System Administrator


Vamsi,

Thank you for the steps to execute this requirement. I will try this and see how it turns out.

I'll reply back/mark this as answered when I'm complete.

Thanks again!


What would happen in this situation if two people were on two different records and at the same time uploaded two different files and clicked the button?