Configure Record Type Filters Share Share via LinkedIn Reddit Email Copy Link Print On This Page This page describes the difference between sync filters and default filters, and how to apply them to your record type. Note: These options are not applicable to record types that use a web service as the source. Instead, you can use the record data source expression to conditionally filter out records. Overview After choosing the source of your record type, you may decide that you don't need all the data from your source, or that you want to exclude certain data to prevent end users from viewing it. From the record type, you can add filters that exclude source data that does not meet the specified criteria. Depending on whether your record type has data sync enabled, the way you filter source data will vary: If you have a synced record type, you can apply sync filters to only sync data that meets specific conditions. If you have an unsynced record type, you can apply default filters to only allow certain records to appear in the record list and views based on the conditions you specify. Sync filters Note: In the latest version of Appian, existing source filters are now called sync filters. When you enable data sync on your record type, you can apply sync filters to specify which data is synced and available in the record type. Sync filters allow you to work with large data sources and exclude unnecessary data from the record type. For example, let's say you have a database table with 6 million rows of support case data. To sync and access all of this data, you can create two different record types: the Open Case record type and the Closed Case record type. Both record types would point to the same database table, but they each use a different sync filter so that they only sync cases with a specific status. You may also have a Comment record type that stores all comments for all cases. To avoid syncing comments for old or closed cases that aren't relevant anymore, the Comments record type can inherit sync filters from the Open Case record type. This way, the Comments record type only syncs comments for active cases. Learn how to add sync filters. Default filters When your record type does not have data sync enabled, you can use default filters to specify which records appear in the record list and views based on the conditions you specify. When a record is filtered out by a default filter: The record does not show up in the record list. The record is not returned in queries on that record type. Users may not access the views on the record. Each default filter defines a condition that must be true for a record to display in the list. If you have multiple conditions, the record must meet all conditions in order to display. For example, in a Case record type, you may want case managers to view all customer support cases, but you only want support engineers to see the cases that are assigned to them. Using a default filter, you could create a filter condition that states if a logged in user is a member of the Support Engineers group, only return cases assigned to the logged in user; Otherwise, return all customer support cases. Tip: If your record type has data sync enabled, you can use record-level security to achieve this same use case. Learn how to add default filters. Add sync filters You can add sync filters when you configure the source of a record type, or anytime after configuring the source by navigating to the Data Model page of the record type. The sections below explain how to add sync filters after the source of the record type has been configured. To add a sync filter, use one of the following modes: Basic mode Expression mode The table below outlines the key differences between these two modes: Basic mode Expression mode Configuration Use a guided experience to filter by source fields or a relationship. Create an expression using a!queryFilter() or a!queryLogicalExpression() to filter by source fields. Inherit filters from related record types If your record type uses a database as the source, you can filter by a relationship to automatically inherit filters from a related record type. For example, if the Open Case record type has a sync filter configured to only sync open cases, then the Comment record type can filter by its relationship to Open Cases to only sync comments for open cases.When you filter by a relationship, you can also filter by the related record fields from the selected relationship to make your filter more precise. You cannot filter by a relationship, so you cannot inherit filters from a related record type or filter by related record fields. Combine filters Multiple filters are automatically joined using an AND operator. You can join multiple filters using AND or OR operators. Testing If you filter by source fields only, you can test to see how many rows of data will be synced in the base record type.If you filter by a relationship, you cannot directly test to see how many rows will be synced in the base record type. Instead, you are limited to testing how many rows are synced in the related record type. You can then use that number to estimate how many rows of data will be synced in the base record type. You can filter by source fields only, so you can test the filter to see how many rows of data will be synced in the record type. Filter behavior If you filter by source fields, those filters will automatically apply whenever a full sync or smart service sync occurs on the base record type.If you filter by a relationship, that filter will apply only when a full sync occurs on the base record type. Any changes to the related record type will not immediately impact the data synced in the base record type.For example, let's say the Comment record type filters by a relationship to the Open Cases record type. If the Write Records smart service changes an open case to "Closed", then the comments for that closed case will only be removed when a full sync occurs on the Comment record type. You can filter by source fields only, so the filters will automatically apply whenever a full sync or smart service sync occurs on the base record type. Basic mode To add a sync filter using Basic mode: In your record type, go to Data Model. Under SYNC FILTERS, click ADD FILTERS. (Optional) Under Sync Options, configure the following: Schedule full syncs. You must enable this option to filter by a relationship. If you don't, Appian will automatically configure this option when you filter by a relationship. Keep data available at high volumes. You cannot filter by a relationship if this option is enabled. Under Sync Filters, leave the default selection Basic. Click Add Filter > By Source Field to filter by a field from the data source. Select a source field to filter by. Only source types that can be converted to Appian types appear in the dropdown. Select the operator to apply to the filter. Use the context menu next to the field to select how you want to pass the value into the filter. The options in this menu change based on the data type of the field selected. You can enter a static value or enter an expression. Click Add Filter > By Relationship to filter by a relationship. You can only filter by one relationship. Tip: This option is only available on record types that use a database as the source. Select a many-to-one or one-to-one relationship to inherit any filters applied to the related record type. Relationships to a related record type that already filter by a relationship will not appear in the dropdown. Click Filter by Related Record Field to filter by a field from the selected relationship. Select the Ignore Filters with Empty Values checkbox to skip filters that have empty an Value. This option will not appear if you only filter by a relationship. Click TEST FILTER to validate your filter conditions. Click OK. Click SAVE CHANGES. Expression mode To configure a sync filter using Expression mode: In your record type, go to Data Model. Under SYNC FILTERS, click ADD FILTERS. (Optional) Under Sync Options, configure the following: Schedule full syncs. Keep data available at high volumes. Under Sync Filters, select Expression. In the expression editor, enter an expression that returns a list of a!queryFilter() or a!queryLogicalExpression(). Note: Sync filter expressions do not support the now() or loggedinuser() functions, relationship references, or any object references called from the rule! or cons! domain. Click TEST FILTER to validate your filter conditions. Click OK. Click SAVE CHANGES. For example, the following sync filter expression would only sync opportunities that have a status of active and an opportunity level of either "Must have" or "Should have". Any data that does not meet these filter conditions will not be synced in Appian. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 /* (Has a status of "Active" AND has an opportunity level of "Must have" OR "Should have") */ a!queryLogicalExpression( operator: "AND", logicalExpressions: { a!queryLogicalExpression( operator: "AND", filters: a!queryFilter( field: "status", operator: "=", value: "Active") ), a!queryLogicalExpression( operator: "OR", filters: { a!queryFilter(field: "opportunityLevel", operator: "=", value: "Must have"), a!queryFilter(field: "opportunityLevel", operator: "=", value: "Should have") } ) } ) Add default filters To create a default filter, use one of the following options: By Field: Allows you to apply multiple default filters joined by an AND union. Expression: Allows you to apply more complex filters by entering an expression containing a list of a!queryFilter() or a!queryLogicalExpression(). By field Creating filters by field allows you to easily set up filters using three criteria: Field, Operator, and Value. Multiple filters are combined using the AND operator. To create a default filter by field: In your record type, go to Source & Default Filters. Keep the default selection of By Field. Click on New Default Filter. Click the Field dropdown and select the record field that you want to set as the default filter. Select the appropriate comparison from the Operator dropdown. Enter the value for the comparison in the Value field. This is an expression field, so encase text values in quotes. Click OK. Click SAVE CHANGES. Expression Creating filters using an expression allows you to create more complex filters. When configuring sync filters in Expression mode, you must use an expression containing a list of a!queryFilter() or a!queryLogicalExpression(). To create a default filter using an expression: In your record type, go to Source & Default Filters. Select Expression. In the expression editor, enter an expression that returns a list of queryFilter or queryLogicalExpression. Click OK. Click SAVE CHANGES. For example, the following default filter expression returns cases that are either assigned to the logged in user, or cases that are not assigned to the "Global Users" group but are either Urgent or High priority: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 /* (Assigned to User OR (NOT Assigned to "Global Users" AND (priority="Urgent" OR priority="High"))) */ if(a!isUserMemberOfGroup(loggedInUser(),cons!CASE_GROUP_GLOBAL_VIEWERS), {}, a!queryLogicalExpression( operator: "OR", logicalExpressions: { a!queryLogicalExpression( operator: "AND", filters: a!queryFilter( field: "userName", operator: "=", value: loggedInUser()) ), a!queryLogicalExpression( operator: "AND", logicalExpressions: { a!queryLogicalExpression( operator: "AND", filters: a!queryFilter( field: "userName", operator: "<>", value: cons!CASE_ADMIN_DB_KEY_1) ), a!queryLogicalExpression( operator: "OR", filters: { a!queryFilter(field: "priority", operator: "=", value: "Urgent"), a!queryFilter(field: "priority", operator: "=", value: "High") } ) } ) } ) ) Feedback Was this page helpful? SHARE FEEDBACK Loading...