Matrix Loader: CSV rules upload
Summarize
Summary of Matrix Loader: CSV rules upload
The Matrix Loader in ServiceNow CPQ enables administrators to bulk create, edit, and export rules by uploading CSV files. This functionality streamlines configuration management by allowing rule conditions, actions, and logic to be defined in spreadsheets. It accelerates setup, simplifies testing, and facilitates migration between sandbox and production environments without manual rule creation in the admin interface.
Show less
Rules Upload Structure
Each CSV row corresponds to a rule record with specific columns required to define the rule. Key columns include:
- recordtype: Identifies the upload as a rule.
- rulename: The display name of the rule (up to 255 characters, including letters, numbers, spaces, and special characters).
- rulevariablename: Unique identifier used by ServiceNow CPQ (up to 128 characters; must start and end with a letter or number).
- rulestatus: Indicates if the rule is active or inactive; inactive rules are ignored.
- actiontype and actionsubtype: Define the type of action executed (e.g., visibility, message, product) and supplementary details.
- actionfield and actionvalue: Specify the target field and the value applied by the action.
- actionproduct, actionquantity, and actionmandatory: Used for bill-of-material (BOM) product actions.
- grouping: Defines how rule conditions are logically combined (any, all, custom, always).
- resource/operator/value: Specify the condition expressions forming the rule logic.
Condition Groupings and Operators
Condition groupings allow logical combinations of conditions:
- any: OR logic for all conditions.
- all: AND logic for all conditions.
- custom: Complex expressions like (1 OR 2) AND 3.
- always: Rule applies unconditionally.
Supported operators for conditions include equals, not equals, less than, greater than, contains, and their negations.
Best Practices
- Ensure variable names exactly match field references.
- Keep rule descriptions concise yet informative.
- Use inactive status to test rules before production deployment.
- Validate grouping logic carefully to prevent unintended rule evaluations.
- Verify product references align with your Salesforce configuration.
- Utilize provided sample CSV files as templates for correct formatting.
Exporting Rules
Administrators can export all existing rule definitions from the ServiceNow CPQ environment to a CSV file within a ZIP archive for review or migration. This is done through the Rules admin page by applying optional filters and using the Export function, followed by downloading the export from the Notification Center.
Use the Matrix Loader to bulk create, edit, and export rules in ServiceNow CPQ. Define rule conditions, actions, and logic in a CSV file to streamline configuration management and automate large-scale updates.
The the Matrix Loader enables administrators to efficiently upload and manage all rule types in ServiceNow CPQ. Instead of manually creating each rule in the Admin interface, you can define them in a spreadsheet, export the sheet to CSV format, and upload it directly into the environment. This enables faster configuration setup, easier testing, and simplified migration between sandbox and production environments.
Rules upload structure
Each row in the CSV file represents a rule record. The following table outlines the columns and data that the Matrix Loader accepts for rule uploads.
| Column Name | Description | Valid Values | Notes |
|---|---|---|---|
| record_type | Identifies this as a rule upload | rule | Required |
| rule_name | Name displayed on the rule list Admin page | Valid strings can be composed of up to 255 characters, including letters, numbers, spaces, and the following special characters: {}[]()|\~`_^@?<=>;:/.-,+*’&%$#”! |
Required |
| rule_variable_name | Unique string used by ServiceNow CPQ to reference the rule | Valid field variable names consist of up to 128 letters, numbers, and underscores. The first and last character must be a letter or number. | Required; must be unique |
| rule_description | Contextual description for administrator reference | Valid strings can be composed of up to 255 characters, including letters, numbers, spaces, and the following special characters: {}[]()|\~`_^@?<=>;:/.-,+*’&%$#”! |
Optional |
| rule_status | Determines if the rule is active | active, inactive | Required; inactive rules are ignored by the engine |
| action_type | Defines the type of action executed when the rule runs | visibility, message, exclusion, inclusion, determination, product | Required |
| action_sub_type | Supplementary definition augmenting action_type | hide, info, warning, error, hidden, disabled, set, forceset, manufacturing, sales | Optional; depends on action_type |
| action_field | Field to which the action applies | <field variableName> | Required |
| action_value | Value applied to the action_field | Varies by action type | Required for message, exclusion, inclusion, or determination actions |
| action_product | Product reference for bill-of-material (BOM) actions | SFDC Product Code, Product2 ID, or External ID | Required for product actions |
| action_quantity | Quantity of the product added to the BOM | <positive float> or <positive integer> | Required for product actions |
| action_mandatory | Specifies whether a BOM product is optional or mandatory | TRUE, FALSE, <empty> | Optional; defaults to TRUE |
| grouping | Defines how conditions are grouped and evaluated | any, all, custom, always | Required |
| resource / operator / value | Defines condition tuples forming the rule logic | <field variableName>, operator, value | Resource, operator, and value together define the condition expression |
Condition groupings
- any: ORs all conditions defined in the row.
- all: ANDs all conditions defined in the row.
- custom: Allows complex logic expressions, such as (1 OR 2) AND 3.
- always: Applies the rule unconditionally.
Valid operators
- equals (=, ==, equals)
- not equals (!=)
- less than (<)
- less than or equal
- greater than (>)
- greater than or equal (>=)
- contains / not contains
- in / not in
General guidelines
- Always verify variable names match the field references exactly.
- Keep rule descriptions concise but descriptive to aid troubleshooting.
- Use inactive status for testing new rules before enabling in production.
- Validate grouping logic (any/all/custom) carefully to avoid unintended outcomes.
- Ensure product references (Product2 ID or External ID) align with your Salesforce configuration.
Exporting rules to CSV
- In the left Admin navigation pane, click Rules.
- Optional: enter a search string and press Enter to narrow results.
- Click Export. A message confirming export appears at the bottom of the page.
- Open the Notification Center (bottom left) and click the Download link.
Additional information
- Valid strings may include letters, numbers, spaces, and special characters:
{ } [ ] ( ) | \ ~ ` _ ^ @ ? < = > ; : / . - , + * ’ & % $ # " - Rule variable names can contain up to 255 alphanumeric characters and underscores. They must begin and end with a letter or number.
- Cells with gray backgrounds in sample files denote irrelevant fields for the current context.
- Use the provided sample files (Admin → Matrix Loader → Sample Files → Rules) as a template for formatting.