Update Search Template for Auto Table Filter

edited May 21, 2020 in Questions
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

Comments

  • edited May 21, 2020
    Hey Adam,

    You'll want to use a manual picklist. Here's a checklist of what you need:

    1) 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)
    2) Add a condition to your Asset model, WHERE Contracts Id = single specified value (but left blank). Leave that as default off.
    3) Click your filter component. Click the stack icon (Add Option Source).
    4) Click Source Type and choose Rows in a Model
    5) In Option Label Template, use mustache syntax to add what you need.
    6) In the Value to Inject, make sure that you're using the right Id (or equivalent) field to add to your Assets condition above.
    7) Save

    It'll look like this.

    image
    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
  • edited May 20, 2020
    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
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!