I am facing some weird challenge while inserting a record in the target table on using the transform

snow57
Tera Contributor

Hi Team,

 

I have a field of length "255" and while inserting the record using transform map it , the field is not updating the whole text using the transform map. and while inserting the record using the background scripts I can able to do the whole text . and if I do the same thing with another field that has a length of "4000," I can do the full text. 

Did anyone faced the same thing ? Please try to help me on this .

 

Ex: Text support - 1234 ServiceNow User  -- String to be update.

Text support - String updating the transform map

Text support - 1234 ServiceNow User  -- String updating using the background script.

 

Note : used trim() while transformation but no use. 

 

Thanks,

Snow.

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@snow57 

ensure your import set field length matches the max length on the target field.

if not then the text will get truncated while loading to import set field and the same will pass on to the target field.

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

Hi Ankur,

 

Thanks for responding. But there is a no limit in the source table. i am querying with one of the source field and getting the needed field details . assigning to the target field. 

 

Ex :

var x = '1234';

var y = new GlideRecord('sys_user');

y.addQuery('user_id',x);

y.query();

while(y.next()){

y.user_name = target.name;

}

 

Let me know if I am doing wrong.

 

Thanks,

Snow.

hello @snow57

 

so I think you said  "assigning to the target field. " that means assigning should happen right to left not left to right. In above code swap the place of target.name to left so that value will come to it , also use if loop if you are very sure for only one value check. 


Please accept the solution /mark this response as correct or helpful if it assisted you with your question.




Regards,
Animesh

Community Alums
Not applicable

Hello @snow57 ,

 

Here are a few potential reasons and solutions to consider:

  1. Field Length Limitation: The field in your target table might have a length limitation set to 255 characters, which could restrict the text updates through the transform map. You mentioned that another field with a length of 4000 characters allows the full text update. Ensure that the field length is appropriate for the data you're trying to update.

  2. Transformation Script Logic: Review the transformation script used in the transform map. Ensure that there are no truncation or manipulation operations that might inadvertently limit the text length. Verify that the logic preserves the full text during the transformation process.

If you found this helpful, a 'like' is the secret handshake of appreciation!