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. So, there will be only 2 values for Install Status fields which are 'Installed' (1) and 'In Stock' (6) which will be provided by the user in the Excel sheet.

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

1 REPLY 1

Mohith Devatte
Tera Sage
Tera Sage

Hello @Bijay Kumar Sha ,

you can try this  in the source script of the   Operational Status field map record .

 

if(source.u_install_status =="Installed")  //. replace source.u_install_status with the backend name of the source field in your staging table 

{

return "106"; // replace it with the value according to the requirement 

}

else if(source.u_install_status == "In Stock'") //. replace source.u_install_status with the backend name of the source field in your staging table 

{

return "100" // replace it with the value according to the requirement 

}

 

Hope this helps 

Mark the answer correct if this helps you 

Thanks