- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2015 11:53 AM
We received a spreadsheet every month from a vendor with the previous month's shipped items, we want to place this information on the asset record. One issue I'm seeing and would like feedback on how to proceed is that the vendor list the shipped to first name and shipped to last name in separate columns on the spreadsheet. I would like to combine those names on the transform and am unsure on how to proceed with that.
For now the business is OK with the first and last name being in separate fields, but would like them combined into one. I was thinking of a transform script with the source.first_name and source.last_last name, then combining them into the target.shipped_to field but I'm unsure how that would look.
Any help is appreciated.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2015 12:09 PM
There are a couple ways to script this, but here's my favorite. In the "field map" record (not a transform script), open the record up.
Then, assuming that your imported spreadsheet columns are "firstname" and "lastname" enter this script (while making your screen similar to the one below.
Note that you DO NOT want to create duplicate user records, so make sure the "choice action" is set to reject or ignore so you can go through the errors and enter manually/reprocess/handle some other way.
answer = concatFirstLast();
function concatFirstLast(){
if (source.u_firstname && source.u_lastname){
return source.u_firstname + " " + source.u_lastname;
}
return source.u_firstname || source.u_lastname;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2015 12:09 PM
There are a couple ways to script this, but here's my favorite. In the "field map" record (not a transform script), open the record up.
Then, assuming that your imported spreadsheet columns are "firstname" and "lastname" enter this script (while making your screen similar to the one below.
Note that you DO NOT want to create duplicate user records, so make sure the "choice action" is set to reject or ignore so you can go through the errors and enter manually/reprocess/handle some other way.
answer = concatFirstLast();
function concatFirstLast(){
if (source.u_firstname && source.u_lastname){
return source.u_firstname + " " + source.u_lastname;
}
return source.u_firstname || source.u_lastname;
}