mulesoft:从服务器获取excel文件时,如何应用{header:false}选项
在DataWeave中使用RealUrl()函数时,我可以使用{“ header”:false}选项,如下所示,将列作为键和单元格作为JSON对象中的值:
var myInput = readUrl("classpath://examples/Test.xlsx", "application/xlsx", {"header":false})
JSON
{
A: "A1",
B: "B1",
C: "",
D: "",
E: "E1"
}
我使用REST API致电Salesforce检索Excel文件。有没有一种方法可以应用{“ header”的类似选项:false}
能够以与上面的JSON相似的方式提供Excel文件的内容?
In DataWeave when using the readUrl() function, I can utilize the {"header":false} option as shown below to give the column as the key and cell as the value in a JSON object:
var myInput = readUrl("classpath://examples/Test.xlsx", "application/xlsx", {"header":false})
JSON
{
A: "A1",
B: "B1",
C: "",
D: "",
E: "E1"
}
I'm using a REST API call to Salesforce to retrieve an Excel file. Is there a way to apply a similar option of {"header":false}
to be able to provide the content of the Excel file in similar way as JSON above?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用此Mule Docs参考来查看受支持的读取属性。
https://docs.mulesoft.com/datawawaweave/2.4/datawaweave-formats-2.4/dataweave-formats- excel
您可以使用转换消息并使用如下所示的相同值
Use this mule docs references to see supported read properties.
https://docs.mulesoft.com/dataweave/2.4/dataweave-formats-excel
You can use a transform message and use the same value as shown below
您应该在使用
outputMimeType
属性创建负载的操作或源中设置正确的数据格式和属性。 文档对此进行了解释。在这种情况下,操作是
。例子:
You should set the correct data format and properties in the operation or source where the payload is created with the
outputMimeType
attribute. This is explained in the documentation. In this case the operation is the<http:request>
.Example: