How to identify the coalesce fields updating it via transform map?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 08:22 PM
I have a data source and transform map to update records in cmdb_ci_appl table. I need to update primary and secondary sites of some applicationn, We have coalesce on "name" and "application_id" fields to identify the records in target table. However, we have more than 1 record with same name and application_id in target table. So transform map is updating the first identified record. We need to put a validation in place so that correct record will be identified and updated by the transform map. The validation is like, if the sys_class_name == cmdb_ci_appl (this field is not in the map) then only update. Please note that our data source has only 4 fields in it, application_id name, primary site and secondary site, Any ideas on how this can be achieved? Thank you.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 04:05 PM
in the code below it should be ignore=true;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 08:59 PM
Hi,
Below is my understanding -
Target table - cmdb_ci_appl
Fields - application_id, name, primary site and secondary site,
Coalesce fields - application_id and name
Although you have more than one record with same name and application_id If this is the case then you can try below 2 options -
1. Create a new field as Auto Number on cmdb which verify each records and no duplicate will be there. So you can have make this field as coalesce one for the future updation.
2. You need to make all the fields (application_id name, primary site and secondary site) of cmdb_ci_appl table as coalesce one to distinguish each records separately.
Could you let me know the fields primary site and secondary site are reference one? If so, which table they are referring to?
Mark this as Helpful/Correct if applicable.
Regards, Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 09:06 PM
Hi, primary_site and secondary_site are reference fields from cmn_location table, thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 09:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2022 09:29 PM
Hi Sourabh, I tried option 2 and It creates a new record instead of update one, I just need to update one of the records, what differentiates them is the class, , the only records that I want to modify are those that have this class sys_class_name ==cmdb_ci_appl, thank you 🙂