Copy Empty field giving NULL Value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 02:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 12:09 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 12:32 AM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2023 12:32 AM - edited 01-19-2023 12:33 AM
@Mohith Devatte its throwing some error in line target.setValue . it says Assigning to rvalue.