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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 12:54 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 01:06 AM
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