List View filter

I have a doctype where the records are displayed in list view according to the conditions i have written in server side script, Example i have a doctype where i am fetching the records according to the query and displaying them in the front end

now when i try to filter the record

it is not filtering, can anyone tell me what might be the issue

Hi @Swathi_Shiragaddi,

Thank You!

1 Like

see basically this code
frappe.listview_settings[‘Fimer Post Training Evaluation Form Test’] = {
refresh: function(listview) {{
method: ‘’,
callback: function(response) {
if (response.message && response.message.forms) {
var forms = response.message.forms;
var count = response.message.count;‘.list-count’).text(${count} of ${count}); = forms;
listview.render();‘.list-pagination’).css(‘display’, ‘none’);
} else {‘.result’).html(“

No forms available.
error: function(xhr, textStatus, error) {
console.error(“Error fetching forms:”, error);‘.result’).html(“
Error fetching evaluation forms.

import frappe

def get_evaluation_forms_for_user():
session_user = frappe.session.user
if session_user == ‘’ or session_user == ‘Administrator’:
# If the user is, fetch all records
forms = frappe.db.sql(“”"
SELECT * FROM tabFimer Post Training Evaluation Form Test
“”“, as_dict=True)
# For other users, fetch records based on ownership or reporting
forms = frappe.db.sql(”“”
SELECT * FROM tabFimer Post Training Evaluation Form Test
WHERE owner = %s OR reports_to = %s
“”", (session_user, session_user), as_dict=True)

 # Get the count of forms
count = len(forms)

return {
    "forms": forms,
    "count": count

is giving me exact records as requirement in my list view but


but for this code


this filter is not working , can anyone tell me why? in this two records the if i try to filter trainer name it is showing me all the two fetched records and for the code you gave it is not displaying any record, can you check again