Using sysparm_fixed_query as a filter in "Data table from Instance Definition" widget

gratziela
Tera Contributor

Hi,

I want to add in a widget something like "sysparm_fixed_query" used in the backend of ServiceNow.

I use a copy of "Data Table From Instance Definition" widget and add some parameters for the other widget that is called:

data.table_label = gr.getLabel();
var widgetParams = {
table: "sn_customerservice_case",
fields: data.field_list,
o: "state",
d: data.d,
filter: "account=" + gr2.getValue("account"),
window_size: data.window_size,
view: 'sp',
title: options.title,
show_breadcrumbs: true,
enable_filter: true
};
data.dataTableWidget = $sp.getWidget('widget-data-table', widgetParams);

Is there a way to add some parameter that will apply my fixed query and it couldn't be removed? Or what should I change?

 

NOTE: I don't want to hide the filter/breadcrumbs, I just want to fix part of the filter and the user to be able to add more conditions, but not to remove mine. So in this case... show_breadcrumbs to false or enable_filter to false won't work.

 

Thanks in advance!

6 REPLIES 6

Jon Barnes
Kilo Sage

you already have filter set which is good, but you should be able to set show_breadcrumbs: false into your widget parameters to get the filter to hide so they can't change it.

Thanks for the replay! But I wrote in the note above that I don't want to hide my filter or breadcrumbs, I just to modify them in order to the user to BE ABLE TO ADD more filters, but NOT TO REMOVE my filter, the one I have already added.

My apologies, I didn’t see that note.

Archana Reddy2
Tera Guru

Hi,

Found any solution/workaround for this? I have the similar need.