- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 01:29 AM
Hi,
i need to add a field map to map organizations from an external system.
the information that is coming in from the external system is like this " organization/EU/organizationname" i need to map the organizationname part to an existing field in SN.
i know i need to use the split in the source script but i need help on how to do this ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 03:39 AM
You can use as below then
var str = "organization/EU/organizationName";
var organizationName;
var arr = str.split("/");
if(!(arr[2] == "" || arr[2] == undefined || arr[2] == null)){
organizationName = arr[2];
}
else
{
organizationName = arr[1];
}
gs.info("Organization Name: " + organizationName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 03:24 AM
actually there are 2 structures:
organization/EU/organizationname1
and
organization/organizationname1

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 03:39 AM
You can use as below then
var str = "organization/EU/organizationName";
var organizationName;
var arr = str.split("/");
if(!(arr[2] == "" || arr[2] == undefined || arr[2] == null)){
organizationName = arr[2];
}
else
{
organizationName = arr[1];
}
gs.info("Organization Name: " + organizationName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 03:48 AM
thanks Chetan much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 04:36 AM
Hi Chatan,
1 question, sometimes the values coming in from the external system are not exactly the same as in SN.
for example coming in is Euro car parts and in SN its called ECP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 05:47 AM
If you dont mind could you please provide possible responses so that i can try make script on that.