Windchill REST Services Domain Capabilities > Examples for Performing Basic REST Operations > Examples for the PTC Supplier Management Domain > Filtering Parts Based on Sourcing Context and Sourcing Status Using Lambda Expression
Filtering Parts Based on Sourcing Context and Sourcing Status Using Lambda Expression
This example shows you how to filter parts based on sourcing context and sourcing status using the lambda expression. Use the following GET requests.
URI for Filtering Parts with Specified Sourcing Context ID and Sourcing Status Value
GET /Windchill/servlet/odata/ProdMgmt/Parts?$filter=(OEMPartSourcingStatus/any(d:d/SourcingStatus/Value eq 'preferred' and d/SourcingContext/SourcingContextId eq 'com.ptc.windchill.suma.axl.AXLContext:204742')) HTTP/1.1
URI for Filtering Parts with Combinations of Sourcing Status and Contexts
GET /Windchill/servlet/odata/ProdMgmt/ProdMgmt/Parts?$filter=startswith(Name,'OEM') and (OEMPartSourcingStatus/any(d:d/SourcingStatus/Value eq 'preferred' and d/SourcingContext/SourcingContextId eq 'com.ptc.windchill.suma.axl.AXLContext:204742') or OEMPartSourcingStatus/any(d:d/SourcingStatus/Value eq 'do_not_use' and d/SourcingContext/SourcingContextId eq 'com.ptc.windchill.suma.axl.AXLContext:204742')) HTTP/1.1