- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 10:04 PM
Hi, In my table i have 2 fields, CI and company. 1 Company can have multiple CI's and 1 CI can have multiple companies. So when i do a data import it needs to concatenate Company&CI like below example and check if that combination exist. If that exist then it should update else it should insert.
In the below table, i cannot set CI as Coalesce neither i can company as Coalesce but the combination of them is always unique. How do i set a coalesce on the combination field
Example:
CI | Company | Combination |
ABC-01-Avail | XYZ-comp-1 | ABC-01-AvailXYZ-comp-1 |
ABC-02-Avail | XYZ-Comp-1 | ABC-02-AvailXYZ-comp-1 |
ABC-01-Avail | XYZ-Comp-2 | ABC-01-AvailXYZ-comp-2 |
ABC-02-Avail | XYZ-Comp-2 | ABC-02-AvailXYZ-comp-2 |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 10:12 PM
Hello Manikandan,
Concatenating the fields should not be necessary. When you select multiple coalesce fields within ServiceNow, all of the fields must match for the coalesce, in other words, for the record you're trying to add, both the company and CI would need to match (look at https://docs.servicenow.com/bundle/london-platform-administration/page/administer/import-sets/concep...).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 10:12 PM
Hello Manikandan,
Concatenating the fields should not be necessary. When you select multiple coalesce fields within ServiceNow, all of the fields must match for the coalesce, in other words, for the record you're trying to add, both the company and CI would need to match (look at https://docs.servicenow.com/bundle/london-platform-administration/page/administer/import-sets/concep...).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 10:54 PM
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 10:39 PM
Hi,
use below script to concatenate.
answer = (function transformEntry(source) {
// Add your code here
var field1 = source.u_ci;
var field2 = source.u_company;
var comm = field1+" "+field2;
return comm; // return the value to be put into the target field
})(source);
also keep coalesce true.
Thanks,
vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 10:55 PM
Thank you for the code Vishal. This also works