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

Hi,

you can check previous value and current value of that variable

if(current.variables.variableName != previous.variables.variableName){

// your delete logic

}

Regards
Ankur

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

Hi Ankur,

in both variable name should i place the variable which i mentioned earlier?

Hi,

that's correct.

Regards
Ankur

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

You want it only for a particular type of sim card?

In that variable we have two types of sims and both for both when we raise request the attachment which is added during task must be deleted after close completing it