Wait for condition in flow designer not supported by Transform map

ankitsharma_487
Giga Guru

Hi All,

 

I have a scenario where once Import start and transform map finishes and populates the table then a notification should be triggered.

When I am trying to look for wait for condition in flow designer, transform map table is not supported by it 

 

in that case what would be the solution, I tried following

var gr = new GlideRecord("sys_import_set_run");
gr.addEncodedQuery("set.table_name=u_test_import_table^state=complete^set.number="+fd_data._9__look_up_record.record.number);
gr.orderByDesc('sys_created_on');
gr.query();
if(gr.next())
{
return true;
}
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@ankitsharma_487 

you should have notification on this table (sys_import_set_run) and it will run when the transform is complete.

Ensure you give the correct condition for import set table name so that it runs only for your import set table completion.

Create a group with the email to whom it needs to be sent

you can then send the list of inserts, updates etc

AnkurBawiskar_3-1743596453257.png

 

 

Include the group in Who will receive section

Then include the body like this

AnkurBawiskar_2-1743596437251.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@ankitsharma_487 

you should have notification on this table (sys_import_set_run) and it will run when the transform is complete.

Ensure you give the correct condition for import set table name so that it runs only for your import set table completion.

Create a group with the email to whom it needs to be sent

you can then send the list of inserts, updates etc

AnkurBawiskar_3-1743596453257.png

 

 

Include the group in Who will receive section

Then include the body like this

AnkurBawiskar_2-1743596437251.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

ankitsharma_487
Giga Guru

Thanks @Ankur Bawiskar , this helped in getting the stats, also I read your suggestion on other article that wait for condition works on the table on which flow is running so I used some tweak to update some field on catalog task (flow is running on catalog task table . that works .
Thanks 

MitchMeister
Tera Contributor

I know there's already a solution to this but I was able to achieve this by scripting both the "Record" and the "Conditions" fields for the Wait For Condition step. I have a custom action that I created that loads data into an import set and one of the outputs is the import set record it created. For the Wait For Condition step I scripted the Record field to return the output record from that action and Condition I scripted as 'return "state=processed"'. I left the table field blank.

If you're using Look Up Record then you might need to script the Table and Conditions field in order to lookup the sys_import_set table. If you're able to do that then you should be able to use that step's Record output in the Wait For Condition's Record script.