- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 01:38 AM
Yes Shivani.
I want to automate loading and tranformin on form button(UI Action)
How data is fetching into system and what type of file will it be? ..CSV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 02:36 AM
It can be done through data source and schedule this data source on demand basis.
In UI Action, you can call the script to run this scheduled data source basically you can call "Execute Now" ui action script for this data source.
Mark helpful if it resolves the purpose.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 03:01 AM
Refer my blog
Something similar to that you can use and enhance it as per your need
Data load and transform via Catalog Item
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 03:12 AM
Thanks its helpful.
But in my case , its custom table form -- I am adding attachment on it.
How do I attach the workflow - on which condition ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2020 03:15 AM
Hi,
Since that is your custom table and attachment you can use that same script in the UI action itself
your UI action code would look something like this
GlideSysAttachment.copy(current.getTableName(), current.sys_id, 'sys_data_source', '<dataSourceSysId>');
var exportGr = new GlideRecord("scheduled_import_set");
exportGr.addQuery("sys_id", "<RecordSysId>"); // sys_id of the record which you will be creating for scheduled import in step (a)
exportGr.query();
if (exportGr.next()) {
gs.executeNow(exportGr); // this is for scoped app
// SncTriggerSynchronizer.executeNow(schImp_GR); // this is for non scoped app
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader