how to delete a attachment present in task after close completing the task?

Ramya66
Tera Contributor

Hi,

I have a requirement when we attach any files in task after close completing the task the file should get deleted. If we use workflow the workflow contains so many items so the changes will be for all items but i need it particularly for 2 items alone. Is there any other way for this requirement?

1 ACCEPTED SOLUTION

Hi,

then you can use flow designer for this with no script required

Flow triggers when catalog task is closed

Searches for sys_attachment and deletes the record

Remember to save and activate the flow

find_real_file.png

find_real_file.png

find_real_file.png

Regards
Ankur

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

View solution in original post

13 REPLIES 13

you can just add this

if(current.variables.sim_card_variable_name != ''){

// add the above code here

}

 

Regards,

Sumanth

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

You can use Run script after the Catalog Task activity and delete the file

what script did you start with and where are you stuck?

regards
Ankur

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

Hi Ankur,

I haven't started the script in workflow due to usage of workflow for many items. 

Hi,

then you can use flow designer for this with no script required

Flow triggers when catalog task is closed

Searches for sys_attachment and deletes the record

Remember to save and activate the flow

find_real_file.png

find_real_file.png

find_real_file.png

Regards
Ankur

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