Flexi Kanban
  • Introduction
    • πŸ“ƒAbout Flexi Kanban
    • βš–οΈFlexi Kanban in Comparison with Other
    • πŸ“˜What are Kanbans?
    • πŸ“•User's Guide to the Kanban Boards
  • Standard Dashboard
    • πŸš€Getting started
      • How to Build a Simple Kanban Using Creation Wizard Abilities
      • Demo Example: Task Dashboard
      • Demo Example: Events Dashboard
      • Demo Example: Opportunities Dashboard
      • Demo Example: Gantt Dashboard
      • Demo Example: Cases Dashboard
    • πŸ“Basics
      • How to Create Standard Dashboard
      • How to Create Child Dashboard
      • How to Incorporate Child Dashboard into Lightning Page
      • How to Open Dashboard in builder (Edit)
      • How to Share Dashboard
      • How to Clone Dashboard
    • πŸ—οΈConfigure Dashboard
      • Working with Dashboard Layout
      • How to Configure Dashboard Basic Properties
      • How to Configure Dashboard Filters
      • How to Add Dashboard Statistics
      • How to Configure Variables
      • How to Configure Events
      • How to add Dashboard Buttons and Menus
    • πŸ™οΈConfigure Column
      • How to Π‘onfigure Column Properties
      • How to Set Column Groups
      • How to Set and Use Column Custom Attributes
      • How to configure Column Data Source
      • How to work with Related Objects
      • How to configure Column Header
      • How to configure Column Body
      • How to configure Column Footer
      • How to configure Column Container and Filters
    • 🎫Configure Card
      • How to configure Card Properties
      • How to configure Card Data Source and Conditions
      • How to configure Card Compact Layout
      • How to configure Card Layout
      • How to configure and use Card Custom Attributes
      • Configuring Card Movement and Column Junctions
      • Configuring Card Actions
    • πŸ“šGroups of Cards
      • How to configure Card Grouping
    • πŸ”§Tools
      • Using Merge Field Picker
      • Using Formula Editor
      • Configuring CSS styles
      • Configuring Rows, Cells, Menus and Buttons
      • Configuring Handlers
    • πŸ‘“Using Dashboard
      • How to use Kanban API actions
      • How to Incorporate Dashboard into Lightning Page
      • How to build the link to the Dashboard
      • How to Work with Variables
      • How to debug Dashboard
      • How to Work with Filters and Orders
    • ✨Howtos and Best Practices
      • How to configure communication between Dashboards
      • How to configure communication between Dashboard and Form
      • How to display different layouts for the same kanban card
      • How to design kanban for your needs
        • How to colorize cards
        • How to add a quick-filter column
      • What inactive column can be used for
      • Tips and Tricks
  • Composite Dashboard
    • πŸ—„οΈIntroduction
      • πŸ”§How to Create a Composite Dashboard
    • πŸͺ›Working with Composite Dashboard Layout
      • Configuring Parent Dashboard
      • Configuring Child Dashboard
    • πŸ–‡οΈConnections Between Dashboards
    • πŸ”¬Examples
      • !! Calendar Dashboard
    • πŸ₯‡Howtos and Best Practices
      • How to Pass Variables Between Parent and Child Dashboards
  • Components
    • πŸ“‹Forms
      • πŸ“‘Basics
        • Form Building Overview
        • Working with Form Settings
        • Working with Source Object fields
        • How to Preview the Form
        • How to configure the Form Sharing Rules
        • Understanding the Form Dependencies
        • Working with Conditional Styles
        • Working with Conditions
        • Search Over the Form
      • πŸͺ›Tools
        • Variables
        • Additional Fields
        • Context Object
        • Form Action
        • Event
      • Components
        • Add and Remove Form Components
        • Components Basic Properties
        • Components Validation Rules
        • Styling Form and Form Components
        • String Field
        • Text Area Field
        • Rich Text Field
        • Lookup Field
        • Date Field
        • Datetime Field
        • Time Field
        • Number Field
        • Currency Field
        • Multi-Select Field
        • Picklist Field
        • Option: Section
        • Option: Static Text
        • Option: Image
        • Option: Blank Space
        • Option: File
        • Option: Custom Button
        • Option: Custom URL
        • Option: Nested Form
        • Option: Lightning Component
        • List. Related Lists.
      • Using Form
        • How to incorporate Form into the Lightning Page
        • How to incorporate Form into Screen Flow
        • How to build the link to the Form
        • (unpublished, empty)How to incorporate Form into the Lightning Component
        • How to run Form Action from Lightning Component
      • Tricks, Hints and Best Practices
        • How to configure communication between Forms
        • How to pre-populate form fields
        • Deployment of Forms
        • What Are Parameters?
    • 🀾Actions/Action Groups
      • Basics
        • Working with Actions
        • Working with Action Groups
        • Working with Functions
        • Working with Context objects
        • Working with Conditions
      • Types
        • Validation Rule Action
        • Define Variable Action
        • Create Record Action
        • Update Records Action
        • Delete Records Action
        • Send Email Action
        • Callout Action
        • Execute Apex Action
        • KanBan API Action
      • Using Actions
        • !!unpublished empty!! How to execute Action/Group from the SF Process/Flow Builder
        • How to execute Action/Group through the REST api
        • !!unpublished empty!! How to execute Action/Group from the Einstain Bot
        • !!unpublished empty !! How to execute Action/Group from APEX
      • Best Practices
        • !! How to use Execute in background option
        • !! Deployment Actions/Action Groups
  • πŸ“–References
    • βš™οΈApplication Settings
    • ♾️Functions
      • SObject
      • Text
      • Logical
      • Numeric
      • Date and Time
      • JSON
      • System
      • Charts
    • πŸ—ƒοΈQuery Conditions
    • Apex Data Provider
    • πŸ“How to add a Kanban to Navigation Items Panel
    • πŸ‘₯Manage Licenses
    • πŸͺͺAssign Permission Sets
    • πŸ“¦Deployment
      • Deploying Using Standard Credentials
      • Deploying Using Connected App Authentication
      • How to configure the Salesforce Connected Application for Flexi Kanban deployment
  • Grant Login Access to Support
  • Subscription Plans
  • Support Agreement
  • Access License Agreement
  • Privacy Policy
Powered by GitBook
On this page
  1. Components
  2. Actions/Action Groups
  3. Types

Define Variable Action

Last updated 6 months ago

Define Variable allows to create Variables which can be used inside the Action Group or passed as an output other parts.

  • Add an action with the type Define Variable (1).

  • Variable can be of 4 types (2):

    • Text,

    • Query,

    • Apex

    • JSON

Variable will have a string data type. It requires Name (3) property. Value (4) is optional (it will be equal to empty string).

Name can be specified as regular text or can be set dynamically. You can use Variables, Merge Fields to set the name.

Actually it is the way to specify several variables together based on Data Source Objects record fields.

  • Select Query variable type, choose object (5) which fields will be used to set values to variables

  • Click "Add field" button on Fields section (6):

  • Choose Field name (7) and set new Variable name (8):

  • Add condition if necessary: click "Add Condition" button (9) and specify Name, Operator and Value:

The value of variable(s) will be calculated by some program code.

  • Select Behavior (10) to define if only one variable will be returned or several:

Single Variable will define one variable

Multiple Variables will define a number of variables: In case of 'Multiple Variables' the apex class must return the variables string in JSON format.

  • Provide variable name and class name (10, 11).

NOTE: To use this kind of variables you need to have apex class implementing KanBanInterfaces.DefineVariableActionInterface interface.

Below is an example of an apex class that will set variable value

public with sharing class CallApexWrapper implements FLX_KB.KanBanInterfaces.DefineVariableActionInterface {   
    public Object executeDefineVariable(FlX_KB.KanBan_History__c history, sObject record, Object parameters) { 
        Object result = ''; 
        if(parameters == '4') 
            result = 'Hello world';
        return result;  
    }
}

Execute method sets variable based on parameters value - if it equals '4' variable value would be 'Hello world', if not it will be left blank.

NOTE: result could be of any type that can be converted to String

Below is example of the text method that can be used to test example class

@isTest static void executeTest(){
   CallApexWrapper cont = new CallApexWrapper();
   Object result = cont.executeDefineVariable(null, null, '4');
   System.assert(result == 'Hello World');
} 

Select JSON variable type, provide coma separated Names and Values

Use JSON format to enter any number of variables:

Example:

{"AccountSource": "{Account.AccountSource}", "AccountName":"{Account.Name}"}

{$Variables.AccountSource} will return Account.AccountSource value

Save the action. Now you can call it from Kanban and other places.

Variables defined in this Action are available to work in these places:

  • On the Kanban: as usual kanban variables (if these are new variables, they will be created otherwise they will be updated). They can be checked in kanban debug console.

  • On the Form: as fields of special Output context object.

How to work with Output context object: E.g., user has an action that defines some variables (11):

This action returns it's results and user needs to use it in some other action, e.g., in the form. User can specify a Result Handler for current "Define Variable" action and Output context object will be available to select (12). When it is selected, system will suggest names of variables defined by that action (13). And when selected, an Output Variable will be available to use as merge field $Output.variableName (14):

This merge field can be used as a value of some parameter of result handler.

NOTE: For more information about using conditions check following article:

🀾
Working with Conditions
Apex
JSON
How to Work With Action Results
Text
Query