Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC BOM Transformation Domain > Creating a Department Data Object for Multiple Plant Data Objects assigned to a Specific Parts Object
Creating a Department Data Object for Multiple Plant Data Objects assigned to a Specific Parts Object
Example: Creating the Same Department Data Object for All Plant Data Objects
This example shows you how to create the same Department Data object for all the Plant Data objects that are assigned to a specific Parts object. For example, consider five Plant Data objects that are assigned to a Parts object. The request creates five objects of the same Department Data, one for each Plant Data object. Use the following POST URI with the request body.
* 
When NavigationCriteria and view are not passed as parameters, the System Default Navigation Criteria is applied.
URI
POST /Windchill/servlet/odata/BomTransformation/CreateDepartmentData?$expand=DepartmentData
* 
You must apply $expand on DepartmentData, otherwise an empty list is returned.
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "OR:wt.part.WTPart:201394"
}
],
"departmentData": [
{
"@odata.type": "#PTC.BomTransformation.Logistics",
"SupplyChain": "005",
"Location": "005",
"Category": "Quality"
}
]
}
Example: Creating the Same Department Data Object for Multiple Plant Data Objects with Navigation Criteria
This example shows you how to create the same Department Data object for multiple Plant Data objects with Navigation Criteria. The request creates the Department Data object only for the Plant Data objects that have the Filter applied as specified in the Navigation Criteria. For example, consider five Plant Data objects are assigned to a Parts object. Consider that two of the Plant Data objects have the Filter applied. The request creates two objects of the same Department Data, one for each of the two Plant Data objects. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/BomTransformation/CreateDepartmentData?$expand=DepartmentData
* 
You must apply $expand on DepartmentData, otherwise an empty list is returned.
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"parts": [
{
"ID": "OR:wt.part.WTPart:201394"
}
],
"departmentData": [
{
"@odata.type": "#PTC.BomTransformation.Logistics",
"SupplyChain": "005",
"Location": "005",
"Category": "Quality"
}
],
"NavigationCriteria": {
"ID": "OR:wt.filter.NavigationCriteria:200537"
}
}