The CreatorCon Call for Content is officially open! Get started here.

Using onAfter with ignore

Anton15
Giga Guru

Hi

I have successfully used 'ignore = true' before, but what is the purpose of 'ignore=true' in the attached onAfter transformation script?

Please review the attached pic.

Thanks

 

 

 

 

1 ACCEPTED SOLUTION

Sharon Hobart
Mega Guru

If the script is valid and the row should not be processed, I suggest to move the script to be an OnBefore script -- not  an onAfter.

View solution in original post

6 REPLIES 6

ersureshbe
Giga Sage
Giga Sage

Hi, If you add the ignore = true the transaction should be ignored. i.e, when the transaction is received in import set table and it will check the transformation script based on your if condition the transaction should be rejected.

 

Mainly, it's used to validate the empty values or not / Unique id is missing validations.

 

Regards,

Suresh.

 

Regards,

Suresh.

Regards,
Suresh.

Thank you Suresh.

Please note this is an onAfter event - here the record is transformed and committed to the target table.

So, surely the script is pointless?

Thanks

Anton

 

Hi, if you want to apply the ignored state then it should be onBefore else you can directly write inside the transform map script (ie., above the field mapping tab)

Regards,

Suresh

Regards,
Suresh.

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Anton15 ,

I got below information from servicenow docs :-

When ignore is set to true, the current row transformation will be skipped and the remaining rows will be processed.

If you have defined an onAfter script, the onAfter script runs for the current row even if the ignore flag is set to true.

 

Refer link for more info :-https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/script/server-scripting/... 

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy