Digia Academy
Digia StudioDiscordLinkedIn
  • Introduction
    • FAQs
  • What's New
    • 2024
      • March
  • DIGIA STUDIO INTRODUCTION
    • Dashboard
    • Builder Tool
      • Navigation Menu
      • Tool Bar
      • Pages and Widgets Panel
      • Canvas Area
      • Properties Panel
    • Creating a New Project
    • Creating new Pages
    • Working with Widget Tree
    • Build Your First App
      • Hello World
      • Bytes App
        • Onboarding
        • Defining API Calls
        • Courses
        • Articles
        • Viewing your App
    • SDK Integration
      • Insert Single Pages from Digia Studio
  • Actions
    • Call API Rest Action
    • Call Rest API
    • Pop Current
    • Pop to Route
    • openUrl
    • Go To Page
    • Post Message
    • Set Page State
    • Wait (delay)
    • Drawer
    • Toast
    • Open Dialog
    • Share
    • Copy to Clipboard
  • Operations
    • API Call
    • Operators
      • Json Operators
      • Logical Operators
      • Date Time Operators
      • Math Operators
      • String Operations
  • BUILDING UI
    • Widgets
      • Form Widgets
        • PinField
        • Calendar
        • Text Form Field
      • Base Widgets
        • Animated Button
        • Check Box
        • Video Player
        • Spacer
        • Stack
        • Wrap
        • Text
        • Avatar
        • Rich Text
        • Image
        • Button
        • Icon
        • Switch
        • Sized Box
        • HtmlView
        • Lottie Animation
        • Linear Progress Bar
        • YouTube Player
        • Circular Progress Bar
      • Layout Widgets
        • ListView
        • Web View
        • Future Builder
        • Conditional Builder
        • Stream Builder
        • GridView
        • Column
        • Row
        • Container
        • Expandable
        • Divider (Horizontal)
        • Divider (Vertical)
        • Carousel
      • Persistent Footers Widgets
        • NavigationBar Widget
      • Page Widgets
        • Stepper Widget
        • Scaffold Widget
        • Paginated Listview Widget
        • TabView
        • AppBar
      • Widget Commonalities
    • Event Handlers
  • Theme
    • Colors
    • Typography
  • DATA AND BACKEND
    • API Calls
      • Setting up API Calls
      • Create API Calls
      • Import API From Curl
  • DEPLOYING YOUR APP
    • Deployment
    • Release History
  • Settings
    • App Settings
    • App Assets
    • Media Assets
  • JARGON
    • Data integration
Powered by GitBook
On this page
  1. Operations
  2. Operators

Logical Operators

PreviousJson OperatorsNextDate Time Operators

Last updated 3 months ago

To understand and effectively apply Logical operators on Digia Dashboard than you should have knowledge of Json operators.

There are various logical operators support on PIM's Dashboard

  • Equal Operator (isEqual)

  • Not Equal Operator (isNotEqual)

  • Null Operator(isNull)

  • Not Null Operator (isNotNull)

  • Not Operator(not)

  • Greater than Operator (gt)

  • Greater than equal to Operator (gte)

  • Less than operator (lt)

  • Less than equal to Operator (lte)

  • Or Operator (or)

  • And Operator (and)

  • If Operator ( if )

1. Equal Operator (isEqual)

when we have to check two operands are equal or not than we use Equal Operator. If both the operands are equal than this operator will return true otherwise it will return false.

Arguments

There are two arguments for equal operators (both are required). These arguments are the two operand for which we want to check the equality.

Let's understand it through a real life example

// Some code
//dummy json
{
   "users": [
      {
         "id": 1,
         "name": "Alice"
      },
      {
         "id": 2,
         "name": "Bob"
      }
   ]
}

If we want to check the id of first user is equal to 1 or not than we can use Equal operator.

// Some code
isEqual(jsonGet(response.body, 'data[0].id'),1)

// Above statement will return true value

  1. Not Equal Operator (isNotEqual)

when we have to check two operands are not equal than we use Not Equal Operator. If the two operands are not equal than this operation will return true otherwise it will return false.

Arguments

There are two arguments for not equal operators (both are required). These arguments are the two operand for which we want to check the equality.

Let's understand it through an example

// Some code
isNotEqual(2,2); //this statement will return false as both arguments are equal.

  1. Null Operator (isNull)

when we have to check that a value is null or not than we can use isNull operator.

Arguments

There is one argument which is the value we want to check that it is null or not. (It is the required argument).

Let's understand it through an example

isNull(null); //this statement will return true
isNull(2); // this statement will return false

4. Not Null Operator ( isNotNull )

when we have to check that a value is not equal to null than we can use isNotNull operator.

Arguments

There is one argument which is the value we want to check that it is null or not. (It is the required argument).

Let's understand it through an example

isNotNull(null); // this statement will return false
isNotNull(2); //this statement will return true

5. Not Operator (not)

Not operator will reverse boolean operation. eg.., true into false and vice versa

Arguments

There is only one argument which is required

Example

not(true); // It will return false
not(false); // It will return true 

6. Greater than Operator (gt)

It will check one number is greater than other or not

Arguments

It will take two arguments and both arguments are required

Example

// If first argument is greater than second argument than it will return true otherwise false
gt(3,2); // It will return true
gt(2,3); // It will return false

7. Greater than Equal to Operator (gte)

It will check one number is greater than equal to other number or not

Arguments

It will take two arguments and both arguments are required

Example

// If first argument is greater than equal to second argument than it will return true otherwise false
gte(3,3); // It will return true
gte(3,2); // It will return true
gte(2,3); // It will return false

8. Less than Operator (lt)

It will check one number is Lesser than other or not

Arguments

It will take two arguments and both arguments are required

Example

// If first argument is Lesser than second argument than it will return true otherwise false
lt(3,2); // It will return false
lt(2,3); // It will return true

9. Lesser than Equal to Operator (lte)

It will check one number is lesser than equal to other number or not

Arguments

It will take two arguments and both arguments are required

Example

// If first argument is greater than equal to second argument than it will return true otherwise false
lte(3,3); // It will return true
lte(3,2); // It will return false
lte(2,3); // It will return true

10. Or Operator (or)

It will take two expressions if at least one expression is true than it will evaluate to true otherwise false

Expression 1
Expression 2
Result

true

true

true

true

false

true

false

true

true

false

false

false

Arguments

It will take two arguments and both arguments are required and are boolean expressions

Example

or(gt(3,2),gt(2,3))
//It will return true
//Explanation
//gt(3,2) will return true and gt(2,3) will return false
// true or false  = true (From the above table)

11. And Operator (and)

It will take two expressions as argument and evaluate to true only if both the expressions are true otherwise false

Expression 1
Expression 2
Result

true

false

false

false

true

false

true

true

true

false

false

false

Arguments

It will take two arguments and both arguments are required and are boolean expressions

Example

and(gt(3,2),gt(2,3))
//It will return false
//Explanation
//gt(3,2) will return true and gt(2,3) will return false
// true and false  = false (From the above table)

12 . if Operator ( if )

Returns the value corresponding to the first true condition. If no conditions are true, returns the last argument as default

Arguments

if(condition, value, [condition2, value2, ..., elseValue]) . It will take a condition and more than one value to output

Example

if(gt(5,2),'greater','lesser')
//it will output greater as the condition is true
Json Operators