Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Field length check in Transform script

SK41
Giga Guru

Hi,

I  have a requirement in transform map where  i  have to reject  the record or ignore that particular string field if the  value  in  that  string field exceeds the length  of the field. This data is  coming  through excel  into my  instance table.

Please help me in this regard asap.

Thanks in Advance!     

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hi,

In the transform map, click on the source field whose length you wanted to check.

if(source.u_your_field.toString().length>7) {

ignore=true;

}

Note: you need to mention the right field name and length you wanted to check in the code.

Mark the comment as correct/helpful if it helps to solve the problem.

View solution in original post

15 REPLIES 15

Can i make use of script include to achieve this to make it configurable?

Does it make sense to make it configurable or should i use the above script(hard-code max length) for other fields too to check the length?