Copy attachment from one record to data source in flow designer

Asmita7
Tera Expert

Hi Friends,

I am working on a flow designer. I want to upload the data in attachment into target table via import set (data source)

1. End user will attach a file to catalog item.

2. The attachment will be displayed on RITM variables.

Asmita7_0-1748580857824.png

3. In flow designer, I am creating "Copy Attachment" action

Asmita7_1-1748580935355.png     Asmita7_2-1748580974100.png

4. I have attached the file to Data Source which is already created in system.

5. After this, I need to run the already created Transform map from Flow itself. How to run the transform map from flow ? Please guide on this.

Thank you for your time.

Asmi

 

 

6 REPLIES 6

Hi Asmita,

 

After your data source step in flow - create a script action or flow variable to trigger the script below.

var schImp_GR = new GlideRecord('scheduled_import_set');
schImp_GR.addQuery('name','your transform map namet');// transform map name - you can do sys id as query as well
schImp_GR.query();
if(schImp_GR.next()){
SncTriggerSynchronizer.executeNow(schImp_GR); // Global Application
//gs.executeNow(schImp_GR); // Scoped Application
 }

 

also you can refer GlideImportSetTransformer API  from servicenow developer references.

 

If this answer is helpful, mark this as correct.

 

Thanks,

Yaswanth

 

 

OlaN
Giga Sage
Giga Sage

Hi,

Before you do the copy attachment action, do a Lookup record (only find one record, not the one with an ending s that finds multiple records) on your datasource table.

Then use the record found in this step, in your copy attachment action.