Trasfering data using flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
I need to trigger a flow when a new datasource is created. The data should be transferred to the target table using the Flow Designer. How can I achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @PALAVALASAB
Create a New Flow in Flow Designer
Steps:
- Trigger:
- Click Add Trigger
- Table: Data Source [sys_data_source]
- Trigger: Created
- Step-by-Step: Using Script Action in Flow Designer
- After the Trigger, click + to add an Action
- Select Script (you may need the Script step enabled)
- Paste the following script:
var importSetRunner = new GlideImportSetLoader();
var importSetRec = importSetRunner.getImportSetTableName(current.sys_id);
if (importSetRec) {
var importSetId = importSetRunner.createImportSet(current.sys_id);
var transformer = new GlideImportSetTransformer();
transformer.setImportSetID(importSetId);
transformer.transformAllMaps();
gs.info("Data Source imported successfully. Import Set ID: " + importSetId);
} else {
gs.error("Failed to get import set table for data source: " + current.name);
}
Thank you
if my response is helpful please mark as helpful and accept the solution