I am using Mule 4 and Anypoint Studio 7.
I want to extract data from an Excel spreadsheet but the table I want to extract data from starts at line 4 in the worksheet and the output from Transform message is null which I assume is because it doesn't detect the column names as they are at line 4 and not line 1.
How can I fix this?
Dataweave XML
<ee:transform doc:name="Transform Message" doc:id="1bdda7fe-2abe-48d3-8bc5-42a94c12b6b9" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
input payload application/xlsx header=true
output application/json
---
{
"Customers": payload."CUSTOMERS" filter $$ > 2 map ( cUSTOMER , indexOfCUSTOMER ) -> {
"Type": cUSTOMER.type,
"Category": cUSTOMER.category
}
}]]></ee:set-payload>
</ee:message>
</ee:transform>
Dataweave code:
%dw 2.0
input payload application/xlsx header=true
output application/json
---
{
"Customers": payload."CUSTOMERS" filter $$ > 2 map ( cUSTOMER , indexOfCUSTOMER ) -> {
"Type": cUSTOMER.type,
"Category": cUSTOMER.category
}
}
Excel
Thanks for any help

header=falseand the body should bepayload[3 to -1]. You could then feed the result of that into your script above. - jerney