Aggregate filter on Case Record Types is not returning unique values

I am new to Skuid (this week)

My page has 3 Models. 1st is to get the Order ID (condition page passes order ID), 2nd to get the Related Case (3 conditions: Order ID match + Case Status <> Closed + Record Type ID is filterable) and 3rd is for the case aggregate filter (groupings Record Type ID and Record type Name)

The table Filter Source Type = Row in Model, Merge Source my 2nd model related cases, Option label template {{ RecordTypeId}} to see name, Which conditions will this source’s options affect = Just the default condition [tried Default condition and others → same result], Value to inject {{{ RecordTypeId}}}

The page/table + filter are working but the values shown in the filter are not unique values
if I have 4 cases in the table 2 service, 1 concierge and 1 portal the filter shows

aggregate filter issue - 2023-10-27_8-58-06

what am I doing wrong?

Hi Dominique, welcome to Skuid! Way to jump right in!

Clarification questions

  1. It sounds like you have an order page with a table of cases related to that order, correct?
  2. The table you’re trying to filter is on related cases (the 2nd model), correct?
  3. Do you have any aggregations in your aggregate model, or just the groupings?

Sanity check:

Since you’re pulling the filter values from an aggregate model, make sure you’re using the field alias to inject in your filter source (instead of the normal field name). This should be something like {{recordTypeId}} for the value and {{{recordTypeName}}} for the label.

Test page

In case it’s helpful, here’s a simple page I’m using to test this. So far I’m just seeing one of each case type, even when there are multiple cases with the same type.

<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" showheader="false">
		<model id="case" limit="" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Case" type="aggregate">
				<field id="Id" name="countId" function="COUNT"/>
			<groupby method="simple">
				<field id="RecordTypeId" name="recordTypeId"/>
				<field id="RecordType.Name" name="recordTypeName"/>
		<model id="casebasic" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Case" limit="20">
				<field id="SuppliedName"/>
				<field id="Subject"/>
				<field id="RecordTypeId"/>
				<field id="RecordType.Name"/>
				<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="RecordTypeId" clientorserver="server" state="filterableoff" inactive="true" name="RecordTypeId"/>
			<groupby method="simple"/>
		<skuid__table allowColumnFreezing="dragDrop" model="case" uniqueid="sk-205b-14251" mode="readonly" showSaveCancel="false" title="aggregate case model (filter options)">
				<field id="RecordTypeId" name="recordTypeId" label="Record type id" uniqueid="fi-205b-14811"/>
				<field id="RecordType.Name" name="recordTypeName" label="Record type name" uniqueid="fi-205b-14812"/>
			<filtering enableSearch="false"/>
			<exportProperties useTableColumns="true"/>
			<sorting enable="false"/>
		<skuid__table allowColumnFreezing="dragDrop" model="casebasic" uniqueid="sk-205q-20381" mode="read" showSaveCancel="true" title="basic case model">
				<field id="SuppliedName" uniqueid="fi-205q-21061"/>
				<field id="Subject" uniqueid="fi-205q-21062"/>
				<field id="RecordTypeId" uniqueid="fi-205q-21063"/>
				<field id="RecordType.Name" uniqueid="fi-205q-21064"/>
			<filtering enableSearch="false"/>
				<action type="multi" label="new">
						<action type="createRow" model="casebasic" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context"/>
			<exportProperties useTableColumns="true"/>
			<sorting enable="false"/>
				<skuid__filter uniqueId="sk-206C-24814" type="select" conditionSource="manual" labelMode="manual" conditionName="RecordTypeId">
						<source type="model" effectsbehavior="justdefault" model="case" labeltemplate="{{{recordTypeName}}}" valuetemplate="{{recordTypeId}}"/>

Let me know if this helps.

Seeing multiple values in your filter options means you are using the same model for your table, as you are using for your filter options. Each row in that model will generate another option in your list. You will need to create another model that only has one row for each value you want in your option list.

Thank you that helped and I was able to complete with a colleague.

1st we stated with a new Aggregate Model (cloned from my 2nd model). This new model now had all the same conditions as table model where the filter will be on (previous Aggregate didn’t have any conditions).

The filter was updated to look at new model (Model Source)created and used
Option label template to {{recordTypeName}}
Value to inject {{recordTypeId}}

1 Like