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

Mark Manders
Mega Patron

Check on the field max length value. Is it large enough to have the data entered?

If my answer helped you in any way, please then mark it as helpful.

Mark


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

Thanks @Mark Manders but doesnt look to have a limit on the target field.

This is the field and dictionary record:

find_real_file.png

Mark Manders
Mega Patron

Strange. Just tried it on my PDI and I could just enter plain text into the html field via import. Can you check the dictionary value on the 'template body'-max length field? Mine was 8000 and I put only a couple of lines in there, so that wasn't an issue.


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

Max length from XML is showing as 8000