Transform Script to bulk update Install Status and Operational Status of asset

Bijay Kumar Sha
Giga Guru

Hi,

I've a requirement to bulk update Install Status and Operational Status of Assets. I've a Data Source and corresponding onbefore Transform script where I need to do the bulk update. 

Please note that Operational Status is depending upon Installation Status and both fields are mandatory. 

Let me provide you the Choice List values for both the fields-

1. If Install Status is 'Installed' (1), then corresponding Operational Status values are Live (105), Pending Repair (106), Pending Return (112)

2. If Install Status is 'In Stock' (6), then corresponding Operational Status values are Available (100), Pending Repair (106).

 

These values is being provided in an excel sheet by the user. 

How I can write the script to do the bulk update? Please help me on this. 

7 REPLIES 7

@Bijay Kumar Sha Refer below script 

var install_status =source.status//please check correct backend name from source table 
var operationa_status= source.operationa_status//please check correct backend name from source table

if(install_status=='Installed'){
if(operationa_status=='Live'||operationa_status=='Pending Repair' || operationa_status=='Pending Return (112)'){
   target.operation_status = operationa_status; //use correct backend name
}
}
else if(install_status=='In Stock'){
if(operationa_status=='Available(100)'||operationa_status=='Pending Repair')//check and  correct choice values
{
   target.operation_status = operationa_status; //use correct backend name
}
}
else {
ignore = true;
}

 Thanks,

Manjusha 

@Bijay Kumar Sha 

 

If  my answer helped you ,please mark it as correct and helpful 

Phanindra N
Tera Guru

You can check the values from the source table and validate in before transform map and ignore the record if validation fails.