Nected Docs
Try Nected For Free
  • 5 min QuickStart Guide
  • Getting Started
    • Introduction
    • Core Concepts
    • Use Cases
    • Tech Architecture
    • FAQs
  • INTEGRATIONS
    • Overview
    • Integrations Libraries
      • PostGres
      • MySQL
      • Oracle
      • MS SQL Server
      • Snowflake
      • MongoDB
      • RedShift
      • REST API
      • Google Sheets
      • Slack
    • Managing Integrations
  • DATASETS
    • Overview
    • Managing Dataset
  • Rules
    • Overview
    • Rule Types
      • SimpleRule
      • DecisionTable
      • Ruleset
      • Rule Chain
    • Rule Conditions
    • Rule Actions
    • Concepts
      • Rule Result
      • Test & Publish Rules
    • Add Input Attributes
      • JSON Input Attributes
      • List Input Attributes
  • Triggers
    • Trigger Rule via API
    • Trigger Rule via WebHook
    • Trigger Workflow via API
    • Trigger Workflow via WebHook
    • Scheduler
    • Rule Response Format
  • Workflow
    • Overview
    • Managing Workflow
    • Add Node
      • Action Nodes
        • Rule Node
        • Workflow Node
        • Custom Code Node
        • Database Node
        • REST API Node
      • Control Nodes
        • Loop Node
        • Delay Node
        • Response Node
        • Set Variables Node
        • Switch Block
    • Test & Publish Workflows
  • CODE AND DATABASE QUERIES
    • JavaScript Editor
    • Formula Editor
    • JSON Editor
    • List Editor
    • Excel-like Function
  • Embedded System
    • White-Labelling
    • Embeddable View
  • Self Hosting
    • Overview
    • Infrastructure Sizing
    • New Installation
      • Docker
      • Kubernetes
        • Set Up Kubernetes Cluster on AWS EKS
    • Additional Configuration
      • High Availability
      • Email Setup Guide
    • Upgrade Nected Version
  • Security
    • API Authentication
      • OAuth as part of Authentication under REST API
    • Role Based Access Control (RBAC)
    • SOC 2 Type 2, GDPR, ISO Compliance
  • Audit
    • Audit Trail
    • Approval Flow
    • Version Control & Rollback
    • Import/Export
  • Management API
    • Audit Log API
    • Global Variable API
  • References
    • Attribute Library
    • Global Variables
    • Pre-Configured Tokens
    • Pre-Configured Operators
    • NULL Value Handling/Behavior
    • Troubleshooting Errors
      • Multiple Tabs/Users Edits
      • Limits in Nected
    • Allowed Status Combinations
    • Environments
    • Usage Widget
    • Gen AI
  • ACCOUNT SETTINGS
    • Workspace Setting
      • Date Format and Timezone Settings
Powered by GitBook
On this page
  • Result Formats in Nected
  • Result token inside Other Results & Actions
  1. Rules
  2. Concepts

Rule Result

PreviousConceptsNextTest & Publish Rules

Last updated 12 days ago

Rule results in Nected define the output of a rule based on its evaluation. They are fundamental for translating the rules' logic into actionable data that can be used within the application. Rule results determine the type of data returned—such as Boolean, Numeric, String, DateTime, JSON, List, JS Code, or Formula—allowing for a wide range of responses tailored to specific business needs or application requirements.

The purpose of rule results is to provide a clear, dynamic, and context-specific output that can be integrated into the broader application ecosystem. Whether it's triggering specific actions, influencing user interfaces, or driving decision-making processes, rule results enable customizable and scalable responses based on user-defined conditions.

Rule Result is available only for SimpleRule & DecisionTable. It is not available in the Ruleset. You can define output based on matching conditions as per each rule.

When you add data, you specify the type of result you expect from the rule. Nected offers various result data types, including Boolean, Numeric, String, DateTime, JSON, List, JS Code, and Formula. The choice of data type depends on the nature of the rule and the desired outcome.

Nected supports the following nine types of output data and results:

  • Boolean: Use the Boolean type for rule results that require a binary outcome, such as "true" or "false." This type is suitable for decision-making scenarios where the rule needs to confirm or deny a condition based on its evaluation. Like, a rule that checks if a user's input meets certain criteria (e.g., password strength) can return true if the criteria are met and false otherwise.

  • Numeric: The Numeric type handles numbers, including integers and decimals. It is useful for rules that need to calculate values or assess numerical conditions. As a rule, calculating a discount based on purchase volume would use a numeric result to specify the percentage of the discount.

  • String: The String type allows for returning textual data. This versatile type can be used in various contexts, such as generating status messages or labels based on rule evaluation. A rule determining a user’s membership level could return strings like "Gold," "Silver," or "Bronze."

  • Date: Use the Date type for rules that operate based on specific dates. This type is crucial for scenarios where the outcome depends on time-sensitive conditions. A rule that checks whether a promotional offer has expired might return the expiration date of the offer.

  • DateTime: Use the DateTime type for rules that operate based on specific dates and times. The DateTime format follows the RFC3339 standard, like 2024-08-07T12:46:00+05:30. This type is crucial for scenarios where the outcome depends on time-sensitive conditions.

  • : The JSON type is used to return structured data. This format is ideal for complex information that involves multiple levels of detail, which UI elements or other applications can consume. A rule could return a JSON object containing customized user profile information, which a client application can then render accordingly.

  • : The List type handles collections of items, such as arrays or lists of values. It’s useful in scenarios where the rule needs to return multiple values or evaluate conditions across a set of items.

  • : The JS Code type allows users to craft complex results using attribute tokens within a JavaScript editor. This type is suitable for creating dynamic rule responses through custom JavaScript code.

  • : The Formula type is designed for quickly writing Excel-like formulas using tokens to perform mathematical operations. It leverages macros like SUM, SUM_List, MAX, MAX_List, etc., allowing for efficient data manipulation.

Result Formats in Nected

Nected provides three distinct formats for displaying output: Raw, Pretty, and Table. Each format serves a unique purpose, catering to different user preferences and requirements. Understanding these formats helps you quickly interpret rule outputs and choose the most suitable view.

1. Raw Format

The Raw format presents outputs in a complete JSON structure. It is the most detailed view, displaying every aspect of the output, including metadata, execution details, and the full result data. This format is ideal for developers or advanced users who need to see the entire result data without any abstraction.

The raw format is especially useful for debugging the output of the rule and workflow, or integrating with external systems.

2. Pretty Format

The Pretty format simplifies the JSON output without altering the underlying data. It is a visually structured, easy-to-navigate view that maintains the hierarchical structure of JSON. Users can quickly explore the output fields without the need to scroll through a flat JSON file.

The pretty format is useful for quickly examining nested data without losing the structural context. The data is shown with collapsible sections, making it easy to drill down into specific fields, like below:

3. Table Format

The Table format transforms the rule result into a tabular view, showing only the essential result data fields. This is the most user-friendly view for non-technical users who want to quickly understand the outcome without navigating JSON structures.

The table format is useful for viewing and understanding output at a glance. It removed all other elements from the result and only shows the relevant part of the output, like below:

Result token inside Other Results & Actions

Note: The result would be available as a token only in the results defined after this result. The current result key token would not be available in any of the conditions as well as any of the results defined before this result key.

Any result would be available as in the result defined after that result, with the name .outputdata

token
JSON
List
JS Code
Formula