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

how to import and transform source string field to target html field

Khalnayak
Kilo Sage

Hi all,

I am doing a bulk import for the Response templates table.

The template body field on the form is a html field and hence when I transform from the string field it does not work. Nothing is being imported into that field only, rest of the fields are being imported fine.

I tried using below transform map script but does not work:

I am using onBefore transform script, not sure if that is what I should be using.

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	mydata= source.u_short_description;
htmlvalue=GlideStringUtil.getHTMLValue(mydata);
gs.info(htmlvalue);

})(source, map, log, target);

please advise

1 ACCEPTED SOLUTION

so the fix was to uncheck 'run business rules' on the transform map.

View solution in original post

8 REPLIES 8

What is the result if you don't use the transform script, but just do a field-to-field transform?

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

so the fix was to uncheck 'run business rules' on the transform map.

Just to add. Unchecking 'run business rules' didn't work for me, because after reimport, that option would recheck in the transform map. What worked for me, was to deactivate the exact business rule called 'Validate template variables'

Mark Manders
Mega Patron

So a BR was preventing you to update the HTML field? Well, I'm glad it's resolved!


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark