I have a table that displays Assets. I have added a Table Filter that filters by the related Contract. This filter is setup with the “Pick Options and Condition(s)” set to Automatically.
The filter works correctly, however, it only displays the Contract Name and unlike Manual table filters you are unable to change the Label Template. The Contract Name isn’t the best option for the user to search by in this instance.
Interested to know if there is a work around to add additional fields to the label when using an Auto Table Filter. Would love to have it show the Contract Number - End Date - Status for example.
Thank you,
Adam
Hey Adam,
You’ll want to use a manual picklist. Here’s a checklist of what you need:
- Add a ContractsForFilter model with all requisite fields whose values you’ll be merging into the picklist display. Make sure you’re querying it somehow (either on page load, or whenever your model-to-be-filtered is updated)
- Add a condition to your Asset model, WHERE Contracts Id = single specified value (but left blank). Leave that as default off.
- Click your filter component. Click the stack icon (Add Option Source).
- Click Source Type and choose Rows in a Model
- In Option Label Template, use mustache syntax to add what you need.
- In the Value to Inject, make sure that you’re using the right Id (or equivalent) field to add to your Assets condition above.
- Save
It’ll look like this.
I think that should do it. Just make sure that you query that model so you have picklist values.
If I mis-characterized what you need, let me know!
Best,
Aaron
Hey Aaron,
Thank you for the reply. I do have a filter setup this way as a work around, however it is limited in that in order to search all Contracts like the auto filter would I need to open the model up to all Contracts. I get a heap size error when doing so (we are over 100k records).
Was hoping I could use the auto-filter but add additional fields to the search template.
Am I missing something on the ContractsforFilter model that would allow for them to search all without running into the heap size error short of filtering that model to just certain Contracts?
Thank you!
Adam
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.