====Reject====
This [[capture:welcome|Capture]] layer rejects or hides the current frame if certain conditions are met.
A rejected frame is not stored in the database. A hidden frame is stored, but is marked as 'hidden' so it will not be included in downloads.
===Parameters===
^Name^Default^Meaning^
|if||//Optional// - if true, the frame is rejected|
|required||//Optional// - a list of strings. The frame //must// contain //all// of these attribute names.|
|action|ignore|Either //ignore// or //hide//.|
===Description===
This function rejects or hides captures based on conditions.
This is normally used to filter out bad data - for example, unusually short product batches, times when no data was available, or setting reasonable limits on values.
Note that you **ignore** a frame, all processing will stop (later layers won't be run). If you **hide** a frame, the later layers will still be processed as normal.
===Example===
{
"type": "reject",
"required": ["Machine.Speed"],
"action": "ignore"
}
The layer will not record the capture unless it contains the attribute 'Machine.Speed'.
{
"type": "reject",
"if": "{Duration} < 120",
"action": "hide"
}
The layer will hide the capture if it takes less than 2 minutes.