Transform Map GlideRecord Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2019 07:04 AM
Hello,
I am trying to query the a manufacturer table with this script during transform so that it will load the company column in the users table with their manufacturer name based on the conditions in the script. The problem is that the second condition [a1.addQuery("u_flag", true);] in the query is getting ignored. Please help.
Here is the Transform map script:
answer = (function transformEntry(source) {
var mfrID = "";
// Get company record using manufacturer key
if(source.company_seq){
var a1 = new GlideRecord("core_company");
a1.addQuery("u_company_seq", source.company_seq);
a1.addQuery("u_flag", true); //this condition is being ignored.
a1.query();
if(a1.next()){
companyID = a1.getUniqueValue();
}
}
return mfrID;
})(source);
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2019 07:08 AM
Try the following:
answer = (function transformEntry(source) {
var mfrID = "";
// Get company record using manufacturer key
if (source.company_seq) {
var a1 = new GlideRecord("core_company");
a1.addEncodedQuery("u_company_seq=" + source.company_seq + "^u_flag=true")
a1.query();
if (a1.next()) {
companyID = a1.getUniqueValue();
}
}
return mfrID;
})(source);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2019 07:25 AM
Trying this now... I'll let you know if it works in a little bit.
Thanks for the quick reply!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2019 10:29 AM
I have tried and the second condition is still getting ignored