You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Node.js的strong-soap提取Netsuite搜索结果的指定字段值?

从Netsuite搜索结果中提取指定值(Node.js + strong-soap)

我在Node.js中使用strong-soap工具获取Netsuite已保存搜索的结果,目前已成功拿到数据,但需要从中提取指定值。直接用console.log打印的结果结构如下:

[
  {
    '$attributes': { '$xsiType': [Object] },
    basic: { entityId: [Object], customFieldList: [Object] }
  },
  {
    '$attributes': { '$xsiType': [Object] },
    basic: { entityId: [Object], customFieldList: [Object] }
  },
  {
    '$attributes': { '$xsiType': [Object] },
    basic: { entityId: [Object], customFieldList: [Object] }
  },
  {
    '$attributes': { '$xsiType': [Object] },
    basic: { entityId: [Object], customFieldList: [Object] }
  },
  {
    '$attributes': { '$xsiType': [Object] },
    basic: { entityId: [Object], customFieldList: [Object] }
  },
  {
    '$attributes': { '$xsiType': [Object] },
    basic: { entityId: [Object], customFieldList: [Object] }
  }
]

我需要的信息位于entityId和customFieldList对象中,展开后可知目标是entityId的searchValue,以及customFieldList下customField的searchValue,请问该如何访问这些对象以获取目标值?

可行代码示例

const searchRows = result.searchResult.searchRowList.searchRow;
searchRows.forEach((row) => {
   const entityIdValue = row.basic.entityId.searchValue;
   const customFieldValue = row.basic.customFieldList.customField.searchValue;
   console.log(entityIdValue);
   console.log(customFieldValue);
});

内容的提问来源于stack exchange,提问作者TheIronKing

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 23:14:57