Data Issues Report Bind
The Data Issues Report bind allows users to write JavaScript-based business conditions that, when run, will insert custom warning and error messages related to attributes, references, and metadata into the Web UI and within Smartsheets.
For the Web UI, configured error and warning messages display beneath the affected field on Node Details screens and in the 'Recent warning notifications' side panel, which is accessible via the Message Area when the Global Navigation Panel is configured. When the Global Navigation Panel is not configured, error messages will display beneath the field and in a pop-up at the top-center of the screen. For more info about the configuration of the Web UI component mentioned, refer to the Web User Interfaces documentation here.
For Smartsheets, upon validation, the messages are displayed when clicking on / hovering over the cells. Warnings are identified via orange-highlighted cells, and errors via red-highlighted cells. If both an error and a warning are found in the same row, the error will supersede the warning and the first cell in the row will display with a red highlight. For more about using Smartsheets, refer to the Using a Smartsheet topic in the Data Formats > Excel Smartsheet Format section of the Data Exchange documentation here.
This bind is found within the 'Binds to' dropdown, as shown below.
Configuration
To use any bind:
- Create a business rule as defined in the Creating a Business Rule, Function, or Library topic here.
- Edit the business rule as defined in the Editing a Business Rule or Function topic here.
- In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic in the Reference Materials documentation here.
- In the Edit Operation dialog, optionally add Messages, as defined in the Adding a Localized Business Rule Message topic here.
- In the Edit Operation dialog, add JavaScript to call the bind.
Example
The following is an example JavaScript that uses this bind.
Important: The example scripts should not be used as-is without thorough testing, including updating the script to match object and link types that exist on your system. JavaScript variable names are case-sensitive.
As an example, a Node Details screen is set up with a number of business conditions that apply validation to a series of attributes configured on that screen. One of those business conditions is configured to ensure that the correct attribute value for the attribute 'Producer1' is 'Acme.' If any other value besides 'Acme' is entered in this field, an error should be shown. The Data Issues Report bind can be used to create a customized error or warning message to show in the Web UI.
In the screenshot example above, the text 'addError' directs the system to prepend to the text an error icon when the notification displays beneath the 'Producer1' field. If the user instead uses 'addWarning,' the custom text will follow a warning icon below the 'Producer1' field. In addition to this visual treatment of messages, 'addError' and 'addWarning' also dictate how the system handles a given issue. An 'addError' message disallows saves until the described issue is addressed, and an 'addWarning' message allows users to save on-screen data.
As another basic example, another business condition follows that is designed to provide the user with error and warning notifications:
Below are the messages as shown on a Node Details > Node Editor configuration:
The Data Issues Report bind also supports references and metadata in the Web UI, allowing users to view error messages directly below the relevant on-screen component, or within the relevant table.
For instance, error and warning messages generated from running the Data Issues Report bind within business rules on Node Details screens display under the References component (as shown in the screenshot below). The Data Issues Report bind can also be used to configure business conditions that run in the background to, for example, perform validation checks on references and metadata.
The example shown in the screenshot above is configured in the business rule shown below. The numbers displayed in the screenshot will be referenced in the description below.
In the configured business action shown in the screenshot above, a number of operations are covered, but relevant to this topic are the means by which the error notification is shown in the Web UI. Below, the relevant parts of the business action are described.
- The data issues report bind is applied. This is required to bring the message into the Web UI as a warning displaying under the relevant field.
- A Reference Type bind is used, selected from the 'Configuration' bind type, as displayed in the screenshot below:
- The JavaScript text "refs = node.getReferences (acc);" directs the business action to connect with the reference type called out in the Reference Type bind, which is 'Accessory' in this instance.
- The text indicated here directs the business action to act if the reference for the reference type 'Accessory' has no value, or is 'null.' The second line describes what text to add in this instance, which is "There is a missing Product Reference of the type [reference type name]." Using 'addError' direct the business action to insert the message as a notification of the type 'Error,' which means it will display preceded by a red error icon.
And, next are two screenshots (combined) to simultaneously show the associated error and warning messages and how they display upon Smartsheet validation. Typically, these messages only display one at a time depending on the cell you hover over / are in.
The 'Next error' button navigates users to each error or warning cell throughout the sheet, which is extremely useful when dealing with larger data sets.