How to execute scheduled import in flow designer??

martin63
Tera Contributor

Hello all,

I want to execute the scheduled import 3 times in the flow. And if it has given error then incident will be created. I have tried this below is screen shots and script using custom action.

 

But by doing it. It is creating execution records multiply one by one any assistance on this... 

@Ankur Bawiskar 

11.png

 

Input is rec ref - scheduled import record

(function execute(inputs, outputs) {
var rec = new GlideRecord('scheduled_import_set');
rec.addQuery('name','Example LDAP User Import');
rec.query();
if(rec.next()){
count++;
SncTriggerSynchronizer.executeNow(rec);
}
})(inputs, outputs);

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@martin63 

since you want to run it 3 times one by one then why not use Do Until in flow

Also remember to keep track of the error in some flow variable which acts like a global variable for the entire flow execution

If any error then set that flow variable and then after the Do Until ends check value of this flow variable and based on that create incident

How are you determining the error?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar Thanks for reply I want to run scheduled import 3 times and if it occured with error then will create incident. But how to design it in flow...!!

Ramesh Dharava1
Tera Contributor

Hi @martin63 , may i know how you created a trigger point for scheduled data import? could pls give me the steps ?

 

Hii Ramesh i am triggering on daily at 12:00pm and executing scheduled import in flow designer using custom action.

Thankyou