Reputation: 2261
I am trying to fetch value from the properties file
"mykey" = "value"
"mykey1" ="value2"
in mule, we can fetch the value by ${mykey}, but what if mykey is stored in a variable named keyName. I tried fetching the value by writing ${(#vars.keyName)} . But it is not working
Upvotes: 2
Views: 2031
Reputation:
You should be using Mule::p
, just p
could get deprecated in the future.
%dw 2.0
output application/java
var myPropName = "test"
---
Mule::p(myPropName)
Upvotes: 1
Reputation: 11
You can use #[p(vars.keyName)] to retrieve value for key stored in variable keyName from a property file.
Upvotes: 1
Reputation: 424
You can use the p function: https://docs.mulesoft.com/mule-runtime/4.2/dw-mule-functions-p
p('mykey')
Upvotes: 0