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?
thx

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">
	<models>
		<model id="case" limit="" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Case" type="aggregate">
			<fields>
				<field id="Id" name="countId" function="COUNT"/>
			</fields>
			<conditions/>
			<actions/>
			<groupby method="simple">
				<field id="RecordTypeId" name="recordTypeId"/>
				<field id="RecordType.Name" name="recordTypeName"/>
			</groupby>
		</model>
		<model id="casebasic" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Case" limit="20">
			<fields>
				<field id="SuppliedName"/>
				<field id="Subject"/>
				<field id="RecordTypeId"/>
				<field id="RecordType.Name"/>
			</fields>
			<conditions>
				<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="RecordTypeId" clientorserver="server" state="filterableoff" inactive="true" name="RecordTypeId"/>
			</conditions>
			<actions/>
			<groupby method="simple"/>
		</model>
	</models>
	<components>
		<skuid__table allowColumnFreezing="dragDrop" model="case" uniqueid="sk-205b-14251" mode="readonly" showSaveCancel="false" title="aggregate case model (filter options)">
			<fields>
				<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"/>
			</fields>
			<filtering enableSearch="false"/>
			<actions/>
			<rowActions/>
			<massActions/>
			<exportProperties useTableColumns="true"/>
			<sorting enable="false"/>
		</skuid__table>
		<skuid__table allowColumnFreezing="dragDrop" model="casebasic" uniqueid="sk-205q-20381" mode="read" showSaveCancel="true" title="basic case model">
			<fields>
				<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"/>
			</fields>
			<filtering enableSearch="false"/>
			<actions>
				<action type="multi" label="new">
					<actions>
						<action type="createRow" model="casebasic" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="context"/>
					</actions>
				</action>
			</actions>
			<rowActions/>
			<massActions/>
			<exportProperties useTableColumns="true"/>
			<sorting enable="false"/>
			<filters>
				<skuid__filter uniqueId="sk-206C-24814" type="select" conditionSource="manual" labelMode="manual" conditionName="RecordTypeId">
					<sources>
						<source type="model" effectsbehavior="justdefault" model="case" labeltemplate="{{{recordTypeName}}}" valuetemplate="{{recordTypeId}}"/>
					</sources>
				</skuid__filter>
			</filters>
		</skuid__table>
	</components>
	<resources>
		<labels/>
		<javascript/>
		<actionsequences/>
	</resources>
	<background/>
	<interactions/>
	<surfaces/>
</skuid__page>

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