Get Entities by Query
Use the Get Entities by Query action to retrieve metadata details of entities based on a query. You can provide the name or number of the Windchill object to retrieve its metadata.
Complete the following steps to use the Get Entities by Query action in your workflow:
1. Drag the Get Entities by Query action under Windchill to the canvas, place the pointer on the action, and then click or double-click the action. The Get Entities by Query window opens.
2. Edit the Label, if needed. By default, the label name is the same as the action name.
3. To add a Windchill connector type, refer to Supported Windchill Connector Types.
If you previously added a connector type, select the appropriate Connector Type, and under Connector Name, select the connector.
4. Click TEST to validate the connector.
5. Click MAP CONNECTOR to execute the action using a connector that is different from the one that you are using to populate the input fields. In the Runtime Connector field, provide a valid Windchill connector name. For more information about MAP CONNECTOR, see Using Map Connector.
6. In the Entity Type list, select the appropriate entity type.
7. Use the options in the Query Type list to filter the output based on the object properties that you want in the output.
Depending on the entity return type, a query has the following parameters:
Single object—Select Properties, Add Related Items
Collection of objects—Filters, Select Properties, Add Related Items, Limit, Skip
In the Query Type list, select Form-Based Query, Discrete Query, or Raw Query to provide query parameters.
Form-Based Query
a. (Available only for collection of objects) Under the Filter group, do the following:
a. In the Join By list, select a logical operator to join the filter clauses. The default value is and.
b. Under Filter Clauses, click Add to add a filter:
Property—Select a property.
Matching Condition—Select a condition. The condition depends on the type of the property selected such as String, Boolean, and so on.
Value—Enter a property value.
Click Add to add multiple filters. Click to delete any filter that you added.
If you add the same properties and select AND in the Join By list, the attributes are joined by the OR operator.
b. Under Select Properties, click Add, and in the Property list, select the property for which you want to retrieve values.
Click Add to add multiple properties. Click to delete any property that you added.
By default, values for ‘key’ properties are retrieved in the output.
c. Under Add Related Items, click Add, and in the Related Item list, select the related item for which you want to retrieve values.
Click Add to add multiple related items. Click to delete any related item that you added.
Any property marked as NavigationProperty is categorized as a Related Item.
d. (Available only for collection of objects) In the Limit field, enter a value to limit the output to a specified number of entities.
e. (Available only for collection of objects) In the Skip field, enter the number of resources that you want to skip.
f. Under Order By group, do the following:
In Select Attribute list, select the attribute.
In Order list, select Ascending or Descending.
* 
From the complex type attributes only Enum type attributes will be displayed in the order by lookup.
Discrete Query
a. (Available only for collection of objects) In the Filters field, specify OData filter criteria in the propertyName operator 'value' [and | or | not]... format.
For example, number eq '0000222341' or name eq 'PTC' or startswith(name, 'PTC')
b. In the Select Properties field, specify an OData select expression to provide a comma-separated list of property names.
By default, values for ‘key’ properties are retrieved in the output.
c. In the Add Related Items field, specify an OData select expression to provide a comma-separated list of related items.
Any property marked as NavigationProperty is categorized as a Related Item.
d. (Available only for collection of objects) In the Limit field, enter the number of search results that you want to retrieve.
e. (Available only for collection of objects) In the Skip field, enter the number of top search results that you want to skip from the result.
f. In the Order By field, enter an OData orderBy expression in the propertyName [asc | desc] format.
Raw Query
In the Query field, specify an OData query expression.
For example: $select=name,number&$expand=context&$top=2&$skip=1&$orderby=name asc&$filter=name eq 'PTC'
By default, values for ‘key’ properties are retrieved in the output.
Any property marked as NavigationProperty is categorized as a Related Item.
Depending on the entity return type, you can provide filters, limit, and skip parameters in the query expression.
8. Click Show Additional Fields to see additional fields.
In Get OData Annotations, select true to include OData Annotations in the output. The default value is false.
9. Click Done.
Output schema
The output schema for the Get Entities by Query action is a dynamic schema. It changes according to the selected values for the Entity Type,Property, and Related Items fields.
If you selected Form-Based Query to specify query parameters, the output schema provides details of the selected properties only.
For Discrete Query or Raw Query, the output schema contains all properties of the returned object; however it provides values of the selected properties only.
The output schema has an array of objects of the selected entity type and an identifier list that is a comma-separated list of the Windchill OIDs. The following image shows the default output schema:
If you select Entity Type as Parts, then the output schema is as shown in the following figure:
If you select Entity Type as Parts and set the Property to AssemblyMode, then the output schema is as shown in the following figure:
* 
For AssemblyMode, the action returns a value like { "Value": "separable", "Display": "Separable" }. If you want to map the Value field only, then update the mapping as follows:
{{$a0.Results[0].AssemblyMode.Value}}
If you select Entity Type as Parts and set the Property to AssemblyMode and Related Items to Folder, then the output schema is as shown in the following figure:
Was this helpful?