Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Transform map script to insert drop down field values.

Tarasingh26
Tera Expert

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 

1 REPLY 1

Community Alums
Not applicable

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;

}