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-16-2023 08:16 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.
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:41 AM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 03:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 01:01 AM
You can check the values from the source table and validate in before transform map and ignore the record if validation fails.