Skip to main content
added 2104 characters in body
Source Link
cyw_bat
  • 25
  • 1
  • 1
  • 4

UPDATE 2: Thanks to the suggestions, I had an idea which surprisingly worked. Below is the code and screenshot for those who might face the same issue. It's quite a long approach but it works.

{
    "elmType": "div",
    "txtContent": "=if([$FlowStatus] == 'Expired', 'Expired', @currentField",
    "attributes": {},
    "style": {
      "border-radius": "0em",
       "height": "0",
       "min-width": "0em",
       "color": "black",
       "text-align": "center",
       "position": "left",
       "top": "0",
       "right": "0em",
      "background-color": {
        "operator": "?",
        "operands": [
          {
            "operator": "==",
            "operands": [
              "@currentField",
              "Approved"
            ]
          },
          "#ABDB77",
          {
            "operator": "?",
            "operands": [
              {
                "operator": "==",
                "operands": [
                  "[$FlowStatus]",
                  "Expired"
                ]
              },
              "#FF6347",
              {
                "operator": "?",
                "operands": [
                  {
                    "operator": "==",
                    "operands": [
                      "@currentField",
                      "Pending"
                    ]
                  },
                  "#FFD700",
                  {
                    "operator": "?",
                    "operands": [
                      {
                        "operator": "==",
                        "operands": [
                          "@currentField",
                          "Rejected"
                        ]
                      },
                      "#bcbcbc",
                      ""
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    },
    "customRowAction": {},
    "children": []
  }

enter image description here

UPDATE 2: Thanks to the suggestions, I had an idea which surprisingly worked. Below is the code and screenshot for those who might face the same issue. It's quite a long approach but it works.

{
    "elmType": "div",
    "txtContent": "=if([$FlowStatus] == 'Expired', 'Expired', @currentField",
    "attributes": {},
    "style": {
      "border-radius": "0em",
       "height": "0",
       "min-width": "0em",
       "color": "black",
       "text-align": "center",
       "position": "left",
       "top": "0",
       "right": "0em",
      "background-color": {
        "operator": "?",
        "operands": [
          {
            "operator": "==",
            "operands": [
              "@currentField",
              "Approved"
            ]
          },
          "#ABDB77",
          {
            "operator": "?",
            "operands": [
              {
                "operator": "==",
                "operands": [
                  "[$FlowStatus]",
                  "Expired"
                ]
              },
              "#FF6347",
              {
                "operator": "?",
                "operands": [
                  {
                    "operator": "==",
                    "operands": [
                      "@currentField",
                      "Pending"
                    ]
                  },
                  "#FFD700",
                  {
                    "operator": "?",
                    "operands": [
                      {
                        "operator": "==",
                        "operands": [
                          "@currentField",
                          "Rejected"
                        ]
                      },
                      "#bcbcbc",
                      ""
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    },
    "customRowAction": {},
    "children": []
  }

enter image description here

added 2 characters in body
Source Link
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63

UPDATE I've tried the updated code provided by one of the suggestions and below are the results.   

enter image description here

UPDATE I've tried the updated code provided by one of the suggestions and below are the results.  enter image description here

UPDATE I've tried the updated code provided by one of the suggestions and below are the results. 

enter image description here

added 311 characters in body
Source Link
cyw_bat
  • 25
  • 1
  • 1
  • 4

UPDATE I've tried the updated code provided by one of the suggestions and below are the results. enter image description here

It's close to my intended outcome now except the text's vertical alignment is still off (on top instead of middle)

UPDATE I've tried the updated code provided by one of the suggestions and below are the results. enter image description here

It's close to my intended outcome now except the text's vertical alignment is still off (on top instead of middle)

added 28 characters in body
Source Link
cyw_bat
  • 25
  • 1
  • 1
  • 4
Loading
deleted 114 characters in body; edited tags
Source Link
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63
Loading
Source Link
cyw_bat
  • 25
  • 1
  • 1
  • 4
Loading