Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need to run scheduled import from flow designer.

Jaydee1
Tera Guru

Hi All,

 

Can we run a scheduled import from flow, if yes kindly help me on achieving it.

 

Thanks,

Jaydee

4 REPLIES 4

Manmohan K
Tera Sage

Hi @Jaydee1 

 

No, Its not possible to run a scheduled import from a flow

Sebastian L
Mega Sage

You can do it by creating a custom action, that takes a sys_id as input: 

(function execute(inputs, outputs) {
 
  try {
    var exportGr = new GlideRecord("scheduled_import_set");
    exportGr.addQuery("sys_id", inputs.id); // sys_id of scheduled import
    exportGr.query();
    if (exportGr.next()) {
        gs.executeNow(exportGr); //run the scheduled import once/now
    }
  } catch(ex) {
   gs.error('Could not run script step: Run scheduled data import');
  }
 
})(inputs, outputs);

Best regards,
Sebastian Laursen

sourav1999
Mega Guru

Yes, you can run a scheduled import from a flow in ServiceNow. Here are the steps to achieve it:

 

1. Create a Data Source:
- Navigate to System Import Sets > Administration > Data Sources.
- Click New to create a new data source.
- Fill in the necessary details like Name, Type, Import set table name, etc.
- Save the record.

2. Create a Transform Map:
- Navigate to System Import Sets > Administration > Transform Maps.
- Click New to create a new transform map.
- Fill in the necessary details like Name, Source table, Target table, etc.
- Map the fields from the source table to the target table.
- Save the record.

3. Create a Scheduled Data Import:
- Navigate to System Import Sets > Load Data > Scheduled Data Imports.
- Click New to create a new scheduled data import.
- Fill in the necessary details like Name, Data source, Run, Transform Map, etc.
- Save the record.

4. Create a Flow:
- Navigate to Flow Designer.
- Click New to create a new flow.
- Add an action to the flow to run the scheduled data import.
- Save and Activate the flow.

5. Schedule the Flow:
- Navigate to Flow Designer > My Flows.
- Click on the flow you created.
- Click on the Schedule tab.
- Set the schedule for the flow to run.
- Save the record.

 

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - nowgpt.ai

gourabhishe
Tera Contributor

Hi Sourav,

Step 4: Can you help me with what action is being used in this for flow designer?