Needs review This article was migrated from Zendesk and has not yet been reviewed or aligned to the current article template.
This article explains the OData filters to help improve OnePlan performance.
Tips for Building OData Filters
General Guidance
When building filters, you need to use backend name of the field, not the name of the OData field.
When you are filtering on a choice field choice, you need to use the Choice Id.
When filtering on a Boolean field, you need to use lowercase ‘true’ or ‘false’.
When filtering for a specific work item, plan, or resource, use the Work Item Id, Plan Id, or Resource Id values rather than the item/plan/resource name.
Get the Internal Name for a Field
Note
When building filters, you need to use backend name of the field, not the name of the OData field.
Go to the OnePlan Configuration area
.
Go to Fields, and locate the field you need the internal name for. Click the Edit icon
for that field.
In the Edit Field form, locate the Internal Name field. This contains the internal name for the field. Copy this value.
Get the Plan Id Value
In OnePlan, navigate to the plan you would like to the id for.
Click on the User Preferences menu, then select Share With.
- In the Shareable URL, locate the value following PlanId=####. This is the plan id for the current plan - copy the everything after PlanId=.
Get the Choice Id Value
Go to the OnePlan Configuration area
.
Go to Fields, and locate the choice field you need the choice id for. Click the Edit icon
for that field.
In the Edit Field form, click into the Choices field. This will open the Edit Choices form.
- Click the carrot in a column header, then select Columns > Id from the drop-down. The Id field will be added into the view.
- The Id field contains the ids for each choice in the field. Copy the Id for the desired choice value.
Get the Security Group Id and Work Item Type Id
Currently, there is no way to get a security group Id value or work item type Id value directly from OnePlan. However, these values are available in the OData tables. There is a SecurityGroups table that lists out the Ids for each security group in your OnePlan environment (SecurityGroups.Id). The work type ids are available from the Tasks table (Tasks.WorkTypeID). Reach out to your OnePlan representative if you need assistance gettng these values for your OData filters.
Tasks Table Filters
The Tasks table can be pre-filtered in the OData query, enhancing the performance of task data loading. The supported OData filter operators include:
eq: Exact matches
ne: Not equal to
gt: Greater than
lt: Less than
ge: Greater than or equal to
le: Less than or equal to
and: Combines multiple filters with an “and” condition
or: Combines multiple filters with an “or” condition
You can filter on work item types by using the operators above with the work item type ID values.
Tasks Table Filter Example
`?$filter=Fields/Status eq 'NotStarted' or Status eq 'InProgress'`
In this example, I am filtering the Tasks table to display tasks that are Not Started or In Progress. To create this filter, I need the internal name for the Status field, as well as the choice ids for Not Started and In Progress.
Plans Table Filters
The Plans table can be pre-filtered in the OData query, enhancing the performance of plan data loading. This includes plans in plan-type specific tables (e.g. Plan_Project, Plan_Idea). The supported OData filter operators include:
eq: Exact matches
ne: Not equal to
gt: Greater than
lt: Less than
ge: Greater than or equal to
le: Less than or equal to
and: Combines multiple filters with an “and” condition
or: Combines multiple filters with an “or” condition
You can filter on plan by using the operators above with the plan ID values.
Plans Table Filter Example
`?$filter=Fields/BusinessUnit eq 'e1f71a07-23c2-ac69-96b1-b5639b2bb5c7'`
In this example, I am filtering the Plans table by the Business Unit field. To filter on this field, I need to use the field’s backend name, BusinessUnit. I want to filter the table on a specific Business Unit, such as IT, so I only see plans that are associated the the IT Business Unit. Since Business Unit is a choice field, I need to use the choice id for IT.
Plans Table Filter Example: Exclude or Isolate Private Plan Types
OnePlan does not enforce private plan permissions in the OData feed, so data from private plans is returned to anyone who can access the feed. To keep private plan data out of a dataset, or to build a dataset that contains only private plan data, filter the Plans table on the PlanType field using the plan type id. For more information, see Set Up OnePlan OData Reporting.
To exclude a private plan type, use ne:
?$filter=PlanType ne '4f2b7c1e-9a3d-4e58-b6a1-2d8c5e0f7a91'
To exclude more than one private plan type, combine the filters with and:
?$filter=PlanType ne '4f2b7c1e-9a3d-4e58-b6a1-2d8c5e0f7a91' and PlanType ne '8c1d3a6b-5e72-4f09-a4b8-7e6f2c9d1b35'
To isolate private plan types so the dataset contains only their plans, use eq, and combine multiple plan types with or:
?$filter=PlanType eq '4f2b7c1e-9a3d-4e58-b6a1-2d8c5e0f7a91' or PlanType eq '8c1d3a6b-5e72-4f09-a4b8-7e6f2c9d1b35'
In these examples, replace the sample ids with the ids of the plan types that have private plans enabled in your environment.
Resources Table Filters
The Resources table can be pre-filtered in the OData query, enhancing the performance of resource data loading. The supported OData filter operators include:
eq: Exact matches
ne: Not equal to
gt: Greater than
lt: Less than
ge: Greater than or equal to
le: Less than or equal to
and: Combines multiple filters with an “and” condition
or: Combines multiple filters with an “or” condition
You can filter on OnePlan security groups by using the operators above with the security group ID values (instead of the group name).
Resources Table Filter Example
`?$filter=Fields/Rate gt 100`
In this example, I am filtering the Resources table to only display resources with rates greater than $100. To filter on this field, I just need the field backend name.
You can filter on the Date field, and apply greater than, less than, and inclusive date filters.
Dates need to be formatted as yyyy-mm-dd. For example:
`?$filter=Date gt 2025-01-01 and lt 2025-02-25`
Resource Plan Table (ResPlan) Filters
The ResPlan table can be pre-filtered in the OData query, enhancing the performance of resource data loading. The supported OData filter operators include:
eq: Exact matches
gt: Greater than
lt: Less than
ge: Greater than or equal to
le: Less than or equal to
ResPlan Table Filter Examples
You can filter of the Date field.
Date filters for the ResPlan table need to be formatted as** Date [operator] datetime’[yyyy-mm-ddThh:mm:ss]’**. For example, the following filter will bring in resource data after 01 April 2025.
`?$filter=Date gt datetime'2025-04-01T00:00:00'`
You can also combine 2 ifs using an and. For example, the following filter will bring in resource data after 01 April 2025, and before 30 June 2025.
`?$filter=Date gt datetime'2025-04-01T00:00:00' and Date lt datetime'2025-06-30T00:00:00'`
Financial Plan Table (Costs) Filters
The Costs table can be pre-filtered in the OData query, enhancing the performance of resource data loading. The supported OData filter operators include:
eq: Exact matches
gt: Greater than
lt: Less than
ge: Greater than or equal to
le: Less than or equal to
Costs Table Filter Examples
You can filter the Costs table on the Date field.
Date filters for the Costs table need to be formatted as** Date [operator] datetime’[yyyy-mm-ddThh:mm:ss]’**. For example, the following will filter the Costs table to bring in costs for 02 Feb 2025.
`?$filter=Date eq datetime'2020-02-02T00:00:00'
`
You can also combine two ifs with an and. For example, the following will filter the Costs table to bring in costs after 02 Feb 2025 and on or before 02 April 2025.
?$filter=Date gt datetime'2020-02-02T00:00:00' and Date le datetime'2025-04-02T00:00:00'
Timesheet Table Filters
The Timesheet table can be pre-filtered in the OData query, enhancing the performance of timesheet data loading.
The supported OData filter operators include:
eq: Exact matches
gt: Greater than
lt: Less than
ge: Greater than or equal to
le: Less than or equal to
Note
Currently, the Timesheet table can only be filtered based on the timesheet period (not by project, resource, or other).
Timesheet Table Filter Example
You can filter on the PeriodStart and PeriodEnd fields.
Dates need to be formatted as yyyy-mm-dd. For example:
`?$filter=PeriodStart gt 2023-01-01`
You can also combine 2 ifs using an and. For example:
`?$filter=PeriodStart gt 2023-01-01 and PeriodStart lt 2023-03-01`
Comments
0 comments
Article is closed for comments.