Copy Empty field giving NULL Value

Divya Yadav1
Tera Contributor

Hi All,

 

I want to update user record and make first name & last name empty. uploading excel and taking field as blank.

While creating transform map selected Copy empty field as true but getting NULL value instead of empty value in user record.

Any idea why?

 

Regards,

Divya

 

 

 

7 REPLIES 7

Hi @Mohith Devatte 
Yes, we tried by unchecking that copy empty values check box. 

its working but at that point if we want to make other field empty such as department and we have not mentioned it in Transform Script, so this field is not changing to empty.

 

 

@Divya Yadav1 then lets uncheck that and try the script in a bit dynamic way like below

var gr = new GlideRecord('sys_dictionary');
	gr.addQuery('name','your_Source_table_backeend_name');
	gr.query();
	while(gr.next())
	{
var ele = gr.element.toString();
if(source.getValue(ele) =="")

{
var tr = new GlideRecord('sys_transform_entry');
tr.addQuery('source_table','your_Source_table_backeend_name');
tr.addQuery('source_field',ele);
tr.query();
if(tr.next())
{
target.setValue(tr.target_field) ="";
}
}
}

 

Hope this helps 

Thanks

@Mohith Devatte  its throwing some error in line target.setValue .  it says Assigning to rvalue.