- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 06:20 AM
I have a field from which I am trying to push a value to target table but it is not working see screenshot.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 06:49 AM
Did you try writing this script in directly in field map? or do you have one already?
If not, can you create one
Can you check in syslog table, if you are getting any error as part of it, also put gs.info to check what is the final value that you are getting, for a string value, I dont think there should be that much of issue
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 06:26 AM
Hi,
In the future, please paste the actual script using the forum feature: "Insert/Edit Code sample":
Or at the very least, paste the screenshot within your post and not as an attachment. We help hundreds of people on the forums and having us download a file, then the file being of script, isn't ideal.
With the above said, I've always had to lookup the record using GlideRecord. Such as:
var gr = new GlideRecord('table_name');
gr.get(target.sys_id);
gr.setValue('middle_name', secondName);
gr.update();
So this would be placed after your var secondName declaration. Replace table_name with the actual table_name
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 06:31 AM
Thank You Allen for your suggestion. It make sense. Will check and get back to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 06:52 AM
Thanks Allen, It worked,
Just curious why below code didn't worked why we need to Glide target table
var string = source.u_dn;
var secondPart = string.split(',')[2];
var equalPosition = secondPart.search('=');
var secondName = secondPart.substring(equalPosition + 1, 100);
target.middle_name = secondName;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 07:22 AM
Hi,
I see you had my reply marked as Correct and now it's not.
But it works, and it worked for you?
You have to use GlideRecord in an onAfter to access the record and then set the value.
You can choose to use it wherever you want in transform script itself (this is ran before the record is fully transformed), in onAfter (which is done after the row is transformed), etc. it doesn't really matter and it's your preference.
I'd recommend reviewing what I've posted above and use that.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!