running a flow/workflow only once

Deepika54
Tera Contributor

Hello experts, i am stuck on a use case.

I have a table in which  at a time many records are getting inserted,for example at first 56 then 79 etc records got inseted i.e the count is dynamic. Now i need to send only a single email after the record insertion is completed. If i write a flow/worflow/BR to trigger a notification, with the condition when the record is inserted, then i beleive 59 or 79 notifiaction will be sent.. Is there any way i trigger it only once?

4 REPLIES 4

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

How is the data getting inserted is it using a data source and transform map if yes then you can write a event in the Oncomplete transform script with the below code:-

 

gs.eventQueue("eventname", target, 'recipient1','recipient2');

 

Please mark my answer as correct based on Impact.

Thank you for your reply. yes that will work but i forgot to add one thing in the question. From my import if records are getting updated then it is going to table A.(through coalesc) but if insertion takes place then i am doing a onBefore script which is Glidequerying to a different table and adding it over there like

if(action=='insert')
{
ignore=true;
var gr=new GlideRecord('u_testingengagement');
gr.initialize();
gr.u_string_2=source.u_engagement_name;
gr.u_string_4=source.u_current_enga_t_manager_name;
gr.insert();

}

Only for the newly created records in the table "u_testingengagement" ,After record creation is completed then i need to send an email . If i write a oncomplete transform scipt then it will not check for insert once actually. I need to trigger a single email if record creation is completed in my "u_testingengagement" table

Hello,

 

But oncomplete will only run after the complete transform map has run(insert/update) so you can fire the event trough on complete should not be an issue,

 

Incase if your worry that what if there are only updates and no insert so you can just glide the table and check if there are any record created in the past 30 mins in u_testingengagement table and if yes then you can fire the event.

 

Please mark my answer as correct based on Impact.

Hello,

 

If my answer helped you can you also mark it as correct.

 

Thanks.