Transform map script to insert drop down field values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 05:46 AM
Hi All,
I have requirement in which I need to import data into table using transform map. Impact type, category and sub category are drop-down values. Category and subcatergory are dependent upon impact type. I have to skip wrong combination of above fields. I have written code attached in screenshot. But it is not working. Can someone please let me know where could be issue?
Thanks,
Tara Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 01:05 AM
You can write script as below may be you have to modify below script as per your requirement .
-----------------------------------------------------------------------------------------------------------------
// Get values from the source
var impactType = source.u_impact_type;
var category = source.u_category;
var subcategory = source.u_subcategory;
-------------------------------------------------------------------------------------------
// Check if the combination is valid
if (isValidCombination(impactType, category, subcategory))
{
// Map the fields to the target
target.impact_type = impactType;
target.category = category;
target.subcategory = subcategory;
} else
{
// Skip the record if the combination is invalid
target.skip = true;
}