Applying Filtering to Data Destinations

 

About

Filtering can optionally be applied to all ProntoForms data destination types for more powerful and flexible handling of submitted forms and associated data.  Filtering functionality allows data destinations to execute only if the filtering rules are met.  Submitted data can be routed to different destinations based on the filtering rules applied.  Alternatively, each Data Destination can route the data in a different format to the same destination depending on the data submitted.  

  • For example, one Data Destination may exclusively route data from “Active” forms, while another may exclusively route data from “Draft” forms. 
  • Or, one standard Data Destination can route all data (from “Active” AND “Draft” forms), while another can route “Draft” form data to an additional destination. 

See the information on each filtering option below for common uses.

[ top ]

 

Filtering Options

To access the filtering options, first create the Data Destination, then enter the Filtering tab.  Note the data destination will only execute if the data record meets ALL filter conditions configured on this page.

filtering_tab.png

 

Form Version State: Archived/Active/Draft

formversionstatw.png

  • Filtering can be based on the state of the form (Active, Draft or Archived) the data record is submitted against.
  • For example, the Draft version of an “Inventory” form might have data submitted against it for testing purposes only. To avoid routing the testing data alongside production data, check only the “Active” option to exclude Draft forms from this data destination.
  • Multiple options can be selected.

[ top ]

 

Data Record State:  Complete/Dispatch Declined

DRstate.png

  • Filtering is applied based on the state of the data record.  “Complete” is the default option and the correct option in most cases.
  • “Dispatched Declined” is a useful option in Data Destinations linked to forms configured for dispatching.  It is typically used to send a notification via an email data destination to the dispatcher if a user declines a dispatch.  Otherwise, the only indication that a dispatch has been declined
  • Both options can be selected as well.

[ top ]

 

Custom Filter Rules 

customfilter.png

The application of custom filter rules is the most powerful and flexible of the filtering options. Rules are applied to data extracted from submitted forms, allowing the data destination to execute only if a specified string is found within the specified field in the data record.  Typical use involves matching a question response.

  • Match All/Match Any: If "All" is selected, all filter rules must be met for the data destination to execute.  If "Any" is selected, at least one rule must be met.  
    • Note that this option only applies  to custom filter rules.  If "Match Any" is selected, the data record must "match any" of the custom filter rules, but must still "match all" of the non-custom rules configured.
  • Input Expression:  This tells the filter which data to look at:  it can be a question response, a form name, a submitter name, etc.   The use of Data Record Expression Language is required.
  • Filter Expression:  This specifies the string to match, and must be a Regular Expression. Note that the Regular Expression is considered a match if it matches any part of the input.

Note:  If configuring an exact match filter rule, remember that the filter string must exactly match; it is case sensitive and does include whitespace. Consequently, exact match filtering rules are best applied to dropdown and radiobutton questions, or questions autopopulated by a data source to avoid user entry errors.

[ top ]

 

Custom Filter Rule Examples

All samples below are based on the same hypothetical "Store Audit" form where a store is given a final rating.  When a form is submitted, an email data destination should filter data records so that the regional manager is only sent an email if the store fails the audit.

 

Simple Match

If the store fails the audit, a "Fail" string is populated into a field with the question label "Rating."

Match Contains Exact Match
Simply type in the string to match.  The below will match a response of any string that contains "Fail" -- Fail, Failed, Failing, No Fail, etc. This filter expression will only match an answer identical to "Fail" -- NOT "Failed", Failing, No Fail,  etc.
contains.png exact.png

Note:  If configuring an exact match filter rule, remember that the filter string must exactly match; it is case sensitive and does include whitespace. Consequently, exact match filtering rules are best applied to dropdown and radiobutton questions, or questions autopopulated by a data source to avoid user entry errors.  

[ top ]

 

Alternation ("Or") 

In the filter rule below, the destination will execute if the store receives a grade of "Poor" or "Fail" -- the vertical bar/pipe functions as "or."  As with above, this is case sensitive.

alternation.png

[ top ]

 

Range

The filter rule below assumes that the store is "rated" on a scale of 1-9; the data destination will execute if the store receives a grade of 1, 2, 3, or 4.  Note that this will only match single characters; if a 10 is entered, the "1" will match and meet the conditions of the filter.  

range.png

[ top ]

 

Answer is Blank/Not Blank

Rather than testing the content of a field to determine if a data destination should execute or not, you may wish to simply test if a field has been answered or not.

If you want the data destination to execute only if there IS an answer, the expression is: ^(?!\s*$).+

If you want the data destination to execute only if the answer is BLANK, the expression is: ^\s*$

[ top ]

Was this article helpful?
3 out of 3 found this helpful
Have more questions? Submit a request

Comments