Append comments using transform script

KeithM2
Kilo Contributor

I'm working on a transform script but I'm not sure how to do it.  I'm updating the assets (alm_hardware table) when we dispose/retire the equipment.  I'm coalescing on the asset tag# and it seems to be working.  What I need help with is when it finds the record, it appends the order # to the comments.  Not every record has something in the comments field, but if it does i don't want to lose it.   Any suggestions?

5 REPLIES 5

Mike Patel
Tera Sage

Can you share how you are adding order # in comments

It is actually a field in the spreadsheet that we are using to update the assets.

joel_ruiz1
Tera Expert

on the transform you can do something like.

target.comments += u_order_number;

 

The += operator is short hand for target.comments = target.comments + u_order_number.

 

This will allow you to keep existing comments and add a order number if there is one.

 

Hope this helps!

 

-Joel R.

Would you use this as an onBefore script or just in place of the transform mapping?