Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Excel as a lookup in dataweave

Tags:

mule

dataweave

QQ - if I have an Excel spreadsheet on the classpath of a Mule app, can I do a lookup against it using dataweave alone?

like image 301
machaval Avatar asked Oct 28 '25 21:10

machaval


1 Answers

In order to use excel as a lookup you need to use the readUrl function using the classpath protocol

var excel = readUrl("classpath://myExcelFile.xlsx", "application/xlsx")
---
(excel.mySheet filter ((entry, index) -> entry.foo == var.foo))[0]
like image 93
machaval Avatar answered Oct 30 '25 13:10

machaval



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!