How to use a recordset filter


A Recordset filter is used to select rows of a recordset that will be used during execution of a child process.
 
The example in this article uses two processes and two recordsets:

       Process 1 is named “Calling a recordset” and is referred to as the parent process.
       Process 2 is named “Calling a recordset_C_UsingFilters” and is referred to as the child process.

       Recordset 1 is named “Calling a recordset” and will be attached to the parent process.
       Recordset 2 is named “Calling a recordset_C_UsingFilters” and will be attached to the child process. 
       Recordset 2 contains the filter values which will be used to filter Recordset 1.
 
Note: The following example and screenshots matches the example given in the April 2014 – Ask The Experts webinar.
 
Screenshot # 1: shows the two processes that are used.

























Screenshot # 2: shows the parent-child relationship between the two processes. As mentioned earlier,
the parent process is called "Calling a recordset" and the child process is called "Calling a recordset_C_UsingFilters".
Notice in the Process Details that Recordset 1 is attached to the parent process.
























Screenshot # 3: shows the Steps of the parent process. There is only one step and it is an "Execute Process" action. The parameters for the action shows the child process and Recordset 2 attached to it. This is also where you enable the RecordSet Filter. To create the filter, click on the icon with the three dots located at the bottom right of the screen.
The next screenshot will show the RecordSet Filter dialog.
























Screenshot # 4: shows the RecordSet Filter. For more information on how to create the filter, please see the Worksoft Online Help.
The next two screenshots will help explain how the filter is used with the two recordsets.

































Screenshot # 5: shows Recordset 1 which contains five records with two values each, State and City.
Only the records in Recordset 1 that match the filter values in Recordset 2 will be processed.
























Screenshot # 6: shows Recordset 2 which contains two records with three values each, State, Contact, and Telephone.
The State(s) in this recordset are called the filter values. The Contact and Telephone values from this recordset will be
added to each record in Recordset 1 where State is equal to “Texas” or where State is equal to “Minnesota”.
























Screenshot # 7: shows the Process Details of the child process. Notice in the Process Details that Recordset 2 is attached
to the child process.

























Screenshot # 8: shows the Steps of the child process. There are two steps: 1) Concatenate action and 2) Comment action.
The parameters for the (Text) Concatenate action shows that the (V)State + (V)Contact + (V)Telephone will be assigned
to (V)Account. The Comment action will display the Account text value represented by T[Account].
























Screenshot # 9: shows the Result Viewer. Notice it ran five times. The first three records were processed and passed.
The last two records were skipped.

























Screenshot # 10: Result Viewer (continued). This shows the Execute Process action and what it looks like when there is a match.

























Screenshot #11: Result Viewer (continued). This shows the child process getting called if the filter finds a match.

























Screenshot #12: Result Viewer (continued). This shows the Execute Process action and what it looks like when there is no match.

























The End.