/
standard_filters.html
140 lines (117 loc) · 5.07 KB
/
standard_filters.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---
layout: default
navPage: docs
heading: Standard Filters
breadcrumbs:
- User Documentation,/userdoc/
- Views,/userdoc/views/
- Editing Views,/userdoc/views/editing/
- Filters Tab,/userdoc/views/filters_tab/
- Standard Filters
prev: Filters Tab,/userdoc/views/filters_tab/
next: Standard Filters - examples,/userdoc/views/standard_filters_examples/
categories: userdoc
tags: views,filters
---
{% include open_section.html nav='nav_userdoc_views.html' selected='standard_filters' %}
<p>
{% include screenshot.html item='i264.gif' %}
A standard filter is where you limit the submissions that appear in the View by
comparing the actual value in a form field to a value or values, specified
in the filter. For example, click
on the screenshot to the right: it shows a single standard filter that limits the
results to submissions that have the value "Delegate" for the Attendee Type field.
In other words, the View only shows Delegate and no other Attendee Types
</p>
<p>
You can assign that view to a client account so that when they log
in they only see submissions from Vancouver.
</p>
<p>
Since standard filters are entirely customizable, you can construct them for whatever
is relevant for your form.
</p>
<p>
Creating a filter is pretty self-explanatory, but here's a few comments about some
of the less obvious things.
</p>
<h3>Operators</h3>
<p>
The second column on the View filters page lets you choose your "operator". An operator
is just a logical rule like "==" (equals) or "!=" (not equals). There are two sets of
operators which appear, depending on the form field you selected.
</p>
<ul>
<li>
<b>Date fields</b>: If you have selected a field with the "Date" field type, the
operator dropdown will contain two options: "before" and "after". Click on the
calendar icon to see a javascript calendar, to help you select and input your
date in the right format.</li>
<li>Other fields: for all other fields, you will see three options: "Equals", "Not
Equals" and "Like".
<ul>
<li><b>Equals</b>: The submission field must be exactly equal to the value or values
defined in the values column for it to appear for the client (N.B. I don't
believe this is case-sensitive).</li>
<li><b>Not Equals</b>: The submission field must not be equal to the value or any
of the values defined in the values column for it to appear for the client.</li>
<li><b>Like</b>: The submission must be "like" the value entered, in other words
it must be a string that contains the string found in the values column.
</li>
<li><b>Not Like</b>: as you'd expect, the opposite of "Like".</li>
</ul>
</li>
</ul>
<p>
The two pairs "equals/not equals" and "like/not like" are similar, but different. For
technical readers, the "like" operators correspond exactly to the SQL "LIKE" clause:
they allows you to do <b>pattern matching</b> on the form submission content - not
strict tests for equality.
</p>
<p>
For example, consider these two rules:
</p>
<ul>
<li>Submission ID, Equals, 10: This will filter out everything except the single
submission with the submission ID value of 10.</li>
<li>Submission ID, Like, 10: This will show any submission whose submission ID contains 10, so :
10, 100, 101, 102, 4010, etc.</li>
</ul>
<h3>Values</h3>
<p>
This is where you enter the string value or values that you want to filter on. Like
with the "operator" column, the contents of this column will change depending on
whether you selected the Submission Date or Last Modified field or not. For the
submission date, you will see a textbox and a calendar icon. Clicking the icon will
open a javascript calendar where you can choose a date and time.
</p>
<p>
Remember that for dropdown fields, radio buttons and checkboxes, you need to define
the field <b>value</b> not the <b>label</b> here. Form Tools always stores the
values of the form fields, not whatever the label happens to be.
</p>
<h3>Multiple Values</h3>
<p>
To save you the bother of having to define multiple, similar filters for the same
form field, you can use the pipe ("|") character to list multiple values for a
single filter.
</p>
<p>
For example, if you had a form containing a "department" dropdown and would like to
filter out all submissions <b>other than</b> those headed to the Arts or Humanities
departments, you could use the "Equals" operator, and enter "Arts|Humanities" in the
values string. If you would like to show everything <b>except</b> Arts and
Humanities, you could use the "Not Equals" operator, and use the same "values"
string. Hopefully, this should work the way you would expect, but here's a breakdown
of the logic for both cases:
</p>
{% codemirror html %}
IF: (("field A" EQUALS "Arts") OR ("field A" EQUALS "Humanities"))
THEN: show the submission.
IF: (("field A" DOES NOT EQUAL "Arts") AND ("field A" DOES NOT EQUAL "Humanities"))
THEN: show the submission.
{% endcodemirror %}
<p>
The following page contains three more examples for common uses of the filters.
</p>
{% include close_section.html %}