Execute Functions
In OData, actions are used to add server-side operations on entities. A function can target a single entity or a collection of entities. Functions return data that does not correspond directly to an entity or collection.
Use the Execute Functions action to execute functions defined in the OData metadata.
Complete the following steps to use the Execute Functions action in your workflow:
1. Drag the Execute Functions action under OData to the canvas, place the pointer on the action, and then click or double-click the action. The Execute Functions window opens.
2. Edit the Label, if needed. By default, the label name is the same as the action name.
3. To add an OData connector type, refer to Supported OData 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 OData connector name. For more information about MAP CONNECTOR, see Using Map Connector.
6. Select the Include Reference Domains check box to display all function that are described by FunctionImport in the referenced domains.
7. In the Functions list, select the OData function that you want to execute.
The fields in the input form change dynamically based on the function that you select.
8. Select Form to provide inputs for individual properties listed in the form, or select Assign JSON to specify a single JSON with all required properties.
9. Use the options in the Query Type list to filter the output based on the object properties that you want in the output. If the function does not return an object, then the Query Type option is not available.
Depending on the return type of the function, 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, if you select any property, then values for the selected properties and ‘key’ properties are retrieved in the output. If you do not select any property, then by default, all entity properties are included 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.
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, if you specify any property in the query, then values for the selected properties are retrieved in the output. If you do not specify any property, then by default, all entity properties are included 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.
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, if you specify any property in the query, then values for the selected properties are retrieved in the output. If you do not specify any property, then by default, all entity properties are included in the output.
Any property marked as NavigationProperty is categorized as a Related Item.
Depending on the return type of the function, you can provide filters, limit, and skip parameters in the query expression.
10. Click Show additional fields.
11. Under the Headers group, click Add to add a custom header to the request. Provide a Key and Value pair.
Click Add to add multiple key-value pairs. Click to delete any custom header that you added.
12. Click Done.
Output schema
Depending on the OData function that you select, the Execute Functions action returns a dynamic output schema. If the function does not have a return type, it returns a message string.
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 specified properties only.
Was this helpful?