How to create an input filter for a status table

hello to all,

I currently have an input that takes the Source Filter to get a filtering from the status table, but I want the input to take the filtering from the Label and not from the source filter.

is there any function or internal property where I can get the filtering from that table using the Label of the alarm/status?

https://docs.inductiveautomation.com/pages/viewpage.action?pageId=72418681#VisionAlarmStatusTable-filterAlarm

should be doable in the extension function

I was referring to an input where if I type for example "production" it searches and displays the labels that contain the word production.

yes you can use inputs in the filterAlarm

def filterAlarm(self, alarmEvent):
	text = self.parent.getComponent('Text Field').text
	if text in alarmEvent.label:
		return True
	return False

it worked! thank you very much

return text in alarmEvent.label

I'd probably use a button to assign the input's text to a custom prop, then use the prop in the filter.

there seems to be a refresh rate on the filter, so its not super response, no need for a button imho

It's just about making the interaction clear for the user.
If there's a pretty button labeled 'apply filter' next to an input field, there's no possible doubt about the course of action required for filtering the table

ahh like that, eh a label is fine too, like he did in his screenshot. placeholder would work too
might want to make it clear if it only filters on the label though, unless if you plan on checking for the text in all properties, which makes it more of a search bar

It tells you it's a filter, but it doesn't tell you how to apply it. Do you just type text ? Do you have to press enter ? When will it be applied ?

Note that I'm saying this but I do use real-time filtering in some applications...

yeah i understand :stuck_out_tongue: But since it doesnt look like you really have control when it applies (it seems to be bound to a refresh rate). Having a button seems weird too, because it wont be the button action that triggers the refresh

I am using this property to make what I am typing in the input take effect

regards.

one last question, is this only for the Alarm status table? will it work for the Alarm Journal too?

yes (though the journal has its own search filter too i think)

Yes, it does, but it seems strange to me that it does not serve the same function, I will dig a little in the documentation to see what I get.

image

thanks again

1 Like