Reputation: 3208
I'm using Nifi's Expression Language to compute 2 dates in order to stick them into a template. I like compute these dates ONCE and to use them into the template as much as I need. My Idea is to do something like:
dateStart = ${now():toNumber():minus(86400):format("YYYY-MM-dd'T'hh:mm:'00'")}
then use ${dateStart}
as I like
How can I assign the expression result to a var ?
Upvotes: 2
Views: 6816
Reputation: 18670
The UpdateAttribute processor is used to add attributes to flow files. From the configuration screen of UpdateAttribute you can click the + icon in the top right to add a property and name it "dateStart" and set the value to your expression. After that you can reference ${dateStart} in other processor properties that support expression language.
Upvotes: 5