AX1772
Using multipass processing with file collect
For example, imagine that your organization has six regions and you want to create and deliver a report package for each region. When using non-multipass processing, this requires you to define six different package columns in the File Collect Configuration Sheet—one for each region. Each package column needs to use different settings such as email addresses, output file names and/or locations, and file filters in order to generate a unique report package for each region.
When using multipass processing, you can define just one package column in the File Collect Configuration sheet. If the source column for multipass processing is Region, then this single package column will be evaluated six times, using a different region for each pass. Assuming that the package column uses dynamic settings, then each pass in multipass processing is resolved differently to generate a unique report package for each region. The function GetCurrentValue can be used in the file collect settings to dynamically return information about the current pass, and a special multipass filter template can be used to dynamically generate the list of files to collect.
Multipass settings
The easiest way to define multipass settings is to designate a Source Column. In this example, the source column is Dept.Region. When multipass processing is performed, the File Collect Configuration sheet will be iteratively processed over the values in the designated column (once per region). All enabled package columns will be processed once per pass.
This works in a similar manner as normal multipass processing, but the goal is slightly different. For example, when performing snapshot multipass processing on a report, you are filtering the report data per pass. When performing multipass processing for file collect, the goal is not to filter report data but simply to dynamically change the package settings per pass.
To confirm that the file will be processed using your desired list of items, click Preview Multipass List. A dialog opens, displaying the total number of items to process, as well as the list of individual items.
If you need to configure advanced multipass settings, you can click Show Advanced View to expose the advanced settings. For example, you may want to define a Source Filter to limit the list of items. For more information, see Configuring advanced multipass settings.
Using GetCurrentValue in file collect settings
You can use the GetCurrentValue function in various file collect settings to dynamically change the settings per pass. The most common use case is in the output file name and/or folder path, and in the email settings to determine the recipient's email address. You might also use the function in the source folder path, if the source files for each path were saved to unique folder locations.
The two most common ways to use the GetCurrentValue function are as follows:
-
The syntax
GetCurrentValue()
returns the name of the current pass value. If you are multipass processing by Dept.Region, and the current pass is for region US West, the function returns "US West". -
The syntax
GetCurrentValue("ColumnName")
returns the value in that column for the current pass. For example, the column Dept.Region looks up to the Region table, and the Region table contains a column named Reporting that holds the target user to receive the report package for each region. If the current pass is for region US West, the functionGetCurrentValue("Dept.Region.Reporting")
returns the name of the user to receive the report package for that region.In order for GetCurrentValue to return a value for a particular column, that column must be used in the multipass settings, typically as a secondary source column. To add more source columns, you can use the advanced multipass settings in the File Processing task pane, or you can go to the File Processing Control Sheet (Control_FileProcessing) and add the additional source columns to the multipass section at the top of the sheet. When editing the File Processing Control Sheet directly, you can also specify default values that the GetCurrentValue function will return when multipass processing is not occurring.
For more information, see GetCurrentValue function and Returning related values for each pass.
NOTE: It is not possible to use the file processing variables such as [Current_Value]
in the File Collect Configuration Sheet. File processing variables are only valid for use in the File Processing Control Sheet.
Output file name and/or folder
The following example shows GetCurrentValue being used to set the output file name, so that the file name changes for each pass. For example, when the pass is performed for region "US West", the name of the file will be resolved as "US West_MonthlyReportPackage". The function returns "Consolidated" when multipass processing is not occurring, because that is the current value default set on the File Processing Control Sheet (as seen on the previous screenshot).
The same concept could be used to change the output folder path per pass, if desired.
Email recipients
The following example shows GetCurrentValue being used to return the name of the user who should receive the report package for each region. In this example, the column Dept.Region looks up to the Region table, and the Region table contains a column named Reporting that holds the target user. If the current pass is for region US West, the function GetCurrentValue("Dept.Region.Reporting") returns the name of the user to receive the report package for that region. The GetUserInfo function is then used to look up the user's email address from security.
The GetCurrentValue function returns user "jdoe" when multipass processing is not occurring, because that is the current value default set on the File Processing Control Sheet.
If the target email addresses were stored in the table directly (instead of looking them up from security), then GetCurrentValue could be used on its own to return the email address.
Using a file filter template
When performing multipass processing with file collect, you can use the (Multipass only) Filter template setting to dynamically filter the files to collect per pass. Although you could use GetCurrentValue in the file filter, the multipass filter template is a more flexible option to set the file filter for multipass processing. The multipass filter template can use a table.column name that will be resolved during each pass to dynamically set the file filter.
For example, imagine that you are performing multipass file collect processing by region, and you want to collect all files that contain a department code that belongs to the current region. Using GetCurrentValue doesn't work in this case, because there are multiple departments per region, and GetCurrentValue("Dept.Dept") would only return one of these values (the max department). Instead you can set a file filter template using {Dept.Dept}
, and a filter will be created for each department value that belongs to the region. For example:
If departments 200, 300, and 600 all belong to the current pass region, then this file filter template will create the following filter:
200*.xlsx, 300*.xlsx, 600*.xlsx
All xlsx files that start with these values will be collected into the report package.