I wnat to create an attribute, format-type, which I hoped would be set
based on the in-coming flowfile name:
${ ${filename:endsWith( 'xml' )} : ifElse( 'XML', 'JSON' ) }
If the in-coming flowfile name is /sample.xml/, the result is
nevertheless and always
format-type = JSON
I want it to
Hello,
The EL docs have some good examples:
https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#ifelse
-Bryan
On Thu, Jun 11, 2020 at 10:14 AM Russell Bateman
wrote:
> I wnat to create an attribute, format-type, which I hoped would be set
> based on the in-coming flowf
Your syntax is incorrect. Try this instead.
${filename:endsWith('xml'):ifElse('XML','JSON')}
From: Russell Bateman
Reply-To: "users@nifi.apache.org"
Date: Thursday, June 11, 2020 at 9:15 AM
To: NiFi Users
Subject: NiFi Expression Language in Update
ussell Bateman
*Reply-To: *"users@nifi.apache.org"
*Date: *Thursday, June 11, 2020 at 9:15 AM
*To: *NiFi Users
*Subject: *NiFi Expression Language in UpdateAttribute
I wnat to create an attribute, format-type, which I hoped would be set
based on the in-coming flowfile name:
${ $
t;mailto:users@nifi.apache.org>
>> Date: Thursday, June 11, 2020 at 9:15 AM
>> To: NiFi Users <mailto:users@nifi.apache.org>
>> Subject: NiFi Expression Language in UpdateAttribute
>>
>> I wnat to create an attribute, format-type, which I hoped w
Hi,
(Copied form Slack channel)
I’m seeing some confusing behaviours with the Expression Language json path
functions and ReplaceText for adding JSON into a file (1.11.3):
given input of (read into a FlowFile attribute named record_json via the
EvaluateJsonPath processor):
{
"person": {
"
A little further investigation/tinkering:
I suspect the ReplaceText issue is that the JSON is being parsed and the
duplicate metadata field is causing a problem, then one of them is being thrown
away
adding a teplaceFirst function call the remove the ,"metadata":{} from the
attribute first has