Skip to main content
12-Amethyst
August 27, 2025
Question

OData Filter by Custom Attribute

  • August 27, 2025
  • 2 replies
  • 258 views

Version: Windchill 12.1

 

Use Case: I am attempting to do an OData call to retrieve parts filtered by a custom attribute on a part. How do I do a GET request with a $filter that allows me to filter a custom attribute?


Description:

 

Attempted URL:

Error message: 

 

{
 "error": {
 "code": null,
 "message": "The property 'MY_ITEM_NUMBER', used in a query expression, is not defined in type 'PTC.ProdMgmt.Part'."
 }
}

 

 

URL's I've tried that do not work:

Error message:

 

{
 "error": {
 "code": null,
 "message": "The URI is malformed."
 }
}

 

 

Other URLs:

 

I tried following the steps here without success: https://community.ptc.com/t5/Windchill/How-to-fetch-part-list-using-custom-attribute-via-Windchill/m-p/969188#M81973

 

Is this possible? Seems like it should be a common thing to do, but I haven't found much help online or in the KBs. Thanks for the help in advance!

2 replies

Catalina
Community Moderator
September 1, 2025

Hi @CB_12625553 

Thank you for your question. 

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Also, feel free to add any additional information you think might be relevant. It sometimes helps to have screenshots to better understand what you are trying to do.

 

Best regards,

Catalina | PTC Community Moderator
12-Amethyst
September 12, 2025

Hi,

 

Please map the property MY_ITEM_NUMBER in PartsExt.json file in the custom rest folder. You could be able to filter based on custom attribute. Refer Adding Custom Properties to Entities in PTC Domains.

 

PartsExt.json

{
"extends": "Part",
"attributes": [
{
"name": "MY_ITEM_NUMBER",
"internalName": "MY_ITEM_NUMBER",
"type": "String"
}
]
}

 

Post the above step you can apply filter like below

https://company.ptcmscloud.com/Windchill/oauth/servlet/odata/ProdMgmt/Parts?$filter=contains(MY_ITEM_NUMBER,  '12345')