Empty Key Field Still Used When Updating NetSuite Line

I have a flow step that updates a line in NetSuite. The line is identified using key fields, such as an external line number or another unique criterion.

I tried configuring two fields as follows:

  • Discard if empty
  • Use as key field to find existing lines

My expectation was that only the key field that actually has a value would be used to identify the line.

However, when sending data to NetSuite, the empty field is discarded as a value, but it is still included as a key. As a result, NetSuite attempts to match on that key and returns an error.

In the example below, the mapping for custcol_test_line_number has no value and is intentionally empty. Despite this, it is still used as a key, which causes the failure.

{
  "nlobjFieldIds": {},
  "nlobjSublistIds": {
    "item": {
      "lines": [
        {
          "custcol_zb_interfacestatus": "Invoice reconciled",
          "custcol_zb_externallinenumber": "10",
          "_keys": [
            "custcol_test_line_number",
            "custcol_test_externallinenumber"
          ]
        }
      ]
    }
  }
}

Why is an empty field still being used as a key even though “Discard if empty” is enabled?

Hi Nuri - just a thought . . . what if you mapped the ‘Only perform mapping when: Source record has a value’ on that key line?

Hi Cory,

Tried that as well and still the key remains in the output:

{
  "nlobjFieldIds": {},
  "nlobjSublistIds": {
    "item": {
      "lines": [
        {
          "custcol_zb_interfacestatus": "Invoice reconciled",
          "custcol_zb_externallinenumber": "10",
          "_keys": [
            "custcol_test_line_number",
            "custcol_test_externallinenumber"
          ]
        }
      ]
    }
  }
}