- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2019 08:57 AM
Hi,
I am stuck on this transform script. I am tasked with appending to the description field in the target table if the source field's value is different. So first I need to check if the description field contains the source field, if not then append. for example:
Source record:
Name LastName Address ID description
John Smith 1 home 123 JSmith.domain.com
Target Table
Name LastName Address ID description
John Smith 1 home 123 George.domain.com
in the above example, instead of updating the record and overriding "George.domain.com", I would like to append a comma and then "JSmith.domain.com" to description. So the result would be this:
Name LastName Address ID description
John Smith 1 home 123 George.domain.com, JSmith.domain.com
Can anyone help me with this? Thank you 🙂
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2019 09:04 AM
Something like this:
if(target.description == source.description)
ignore = true;
else
target.description += ", " + source.description;
though I remember maybe having to query the target record before to get the current description, so you can try that in place of the target.description.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2019 09:04 AM
Something like this:
if(target.description == source.description)
ignore = true;
else
target.description += ", " + source.description;
though I remember maybe having to query the target record before to get the current description, so you can try that in place of the target.description.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2019 09:34 AM
do I run this in the onbefore script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2019 09:39 AM
I think I have run mine onBefore, historically.