title: SharePoint Column Formatting: JSON "@currentField.lookupValue" throws error in case of blank lookup value
body: <p>I've got a SharePoint List with the column "Status - Overall (lookup)" which type is "Lookup". It gets information from another list and there can be only 5 values: "Red", "Amber", "Green", "Gray" or blank value. </p>
  
  <p>I applied conditional column formatting to the column "Status - Overall (lookup)" according to the article: <a href="https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting</a></p>
  
  <p>Here's JSON code which was pasted into "Column Formatting" setting of the List Column:</p>
  
  <pre><code>{
  "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
  "debugMode": true,
  "elmType": "div",
  "attributes": {
      "class": {
          "operator": "?",
          "operands": [
              {
                  "operator": "==",
                  "operands": [
                      {
                          "operator": "toString()",
                          "operands": [
                              "@currentField.lookupValue"
                          ]
                      },
                      "Green"
                  ]
              },
              "sp-field-severity--good",
              {
                  "operator": "?",
                  "operands": [
                      {
                          "operator": "==",
                          "operands": [
                              {
                                  "operator": "toString()",
                                  "operands": [
                                      "@currentField.lookupValue"
                                  ]
                              },
                              "Gray"                            ]
                      },
                      "sp-field-severity--low",
                      {
                          "operator": "?",
                          "operands": [
                              {
                                  "operator": "==",
                                  "operands": [
                                      {
                                          "operator": "toString()",
                                          "operands": [
                                              "@currentField.lookupValue"
                                          ]
                                      },
                                      "Amber"
                                  ]
                              },
                              "sp-field-severity--warning",
                              {
                                  "operator": "?",
                                  "operands": [
                                      {
                                          "operator": "==",
                                          "operands": [
                                              {
                                                  "operator": "toString()",
                                                  "operands": [
                                                      "@currentField.lookupValue"
                                                  ]
                                              },
                                              "Red"
                                          ]
                                      },
                                      "sp-field-severity--severeWarning",
                                      "sp-field-severity--blocked"
                                  ]
                              }
                          ]
                      }
                  ]
              }
          ]
      }
  },
  "children": [
      {
          "elmType": "span",
          "style": {
              "display": "inline-block",
              "padding": "0 4px"
          },
          "attributes": {
              "iconName": {
                  "operator": "?",
                  "operands": [
                      {
                          "operator": "==",
                          "operands": [
                              {
                                  "operator": "toString()",
                                  "operands": [
                                      "@currentField.lookupValue"
                                  ]
                              },
                              "Green"
                          ]
                      },
                      "CheckMark",
                      {
                          "operator": "?",
                          "operands": [
                              {
                                  "operator": "==",
                                  "operands": [
                                      {
                                          "operator": "toString()",
                                          "operands": [
                                              "@currentField.lookupValue"
                                          ]
                                      },
                                      "Amber"
                                  ]
                              },
                              "Forward",
                              {
                                  "operator": "?",
                                  "operands": [
                                      {
                                          "operator": "==",
                                          "operands": [
                                              {
                                                  "operator": "toString()",
                                                  "operands": [
                                                      "@currentField.lookupValue"
                                                  ]
                                              },
                                              "Gray"
                                          ]
                                      },
                                      "Error",
                                      {
                                          "operator": "?",
                                          "operands": [
                                              {
                                                  "operator": "==",
                                                  "operands": [
                                                      {
                                                          "operator": "toString()",
                                                          "operands": [
                                                              "@currentField.lookupValue"
                                                          ]
                                                      },
                                                      "Red"
                                                  ]
                                              },
                                              "Warning",
                                              "ErrorBadge"
                                          ]
                                      }
                                  ]
                              }
                          ]
                      }
                  ]
              }
          }
      },
      {
          "elmType": "span",
          "txtContent": "@currentField.lookupValue"
      }
  ]}
  </code></pre>
  
  <p>This JSON works fine for all lookup values except the blank value which displays the following error: </p>
  
  <blockquote>
    <p>(column-internal-name).lookupValue was not found on the data object.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/OJ7TW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OJ7TW.jpg" alt="enter image description here"></a></p>
  
  <p>Is there a way to fix that? </p>