<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Nifi Expression language ifelse in ReplaceText processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Expression-language-ifelse-in-ReplaceText-processor/m-p/310376#M224130</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/57238"&gt;@adhishankarit&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The issues is being caused by the line returns used in the middle of the NiFi NiFiExpression Language (EL) ifElse() function you are using.&lt;BR /&gt;&lt;BR /&gt;The text box where you enter your NiFi EL uses a NiFi editor that highlights to show proper EL format.&amp;nbsp; You'll notice your EL stops highlighting once you reach first line return. So you'll notice character 32 is the first single quote character.&amp;nbsp; Since EL breaks at this point it fails to find the matching second expected single quote.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-01-25 at 9.14.52 AM.png" style="width: 376px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/30268i0110A10C090CD8BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-01-25 at 9.14.52 AM.png" alt="Screen Shot 2021-01-25 at 9.14.52 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This leaves you with two options:&lt;BR /&gt;1. Create flat json without the line returns.&lt;BR /&gt;2. Looking at result you are trying to achieve, design your NiFi EL differently:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-01-25 at 9.17.48 AM.png" style="width: 621px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/30269i0612E16D2BA478DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-01-25 at 9.17.48 AM.png" alt="Screen Shot 2021-01-25 at 9.17.48 AM.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Note proper NiFi EL highlighting above.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Matt&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2021 14:19:17 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2021-01-25T14:19:17Z</dc:date>
    <item>
      <title>Nifi Expression language ifelse in ReplaceText processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Expression-language-ifelse-in-ReplaceText-processor/m-p/310369#M224129</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to build JSON string using Ifelse condition in ReplaText processor but i am getting error as invalid Invalid Expression .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Working Ifelse condition :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;${status:contains('0'):ifElse('Success','Failed')}&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Invalid_Expression.PNG" style="width: 199px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/30267i3FBB57A226B1D08D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Invalid_Expression.PNG" alt="Invalid_Expression.PNG" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This below string is not working and it is throwing invalid expression . Please assist on this .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;${status:contains('0'):ifElse('{&lt;BR /&gt;"filename":"${overall_filename}",&lt;BR /&gt;"status":"${status}",&lt;BR /&gt;"message":"${overall_message}"&lt;BR /&gt;}',&lt;BR /&gt;'{&lt;BR /&gt;"filename":"${overall_filename}",&lt;BR /&gt;"status":"${exc_status}",&lt;BR /&gt;"message":"${overall_message}"&lt;BR /&gt;}'&lt;BR /&gt;)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 12:20:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Expression-language-ifelse-in-ReplaceText-processor/m-p/310369#M224129</guid>
      <dc:creator>adhishankarit</dc:creator>
      <dc:date>2021-01-25T12:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Expression language ifelse in ReplaceText processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Expression-language-ifelse-in-ReplaceText-processor/m-p/310376#M224130</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/57238"&gt;@adhishankarit&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The issues is being caused by the line returns used in the middle of the NiFi NiFiExpression Language (EL) ifElse() function you are using.&lt;BR /&gt;&lt;BR /&gt;The text box where you enter your NiFi EL uses a NiFi editor that highlights to show proper EL format.&amp;nbsp; You'll notice your EL stops highlighting once you reach first line return. So you'll notice character 32 is the first single quote character.&amp;nbsp; Since EL breaks at this point it fails to find the matching second expected single quote.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-01-25 at 9.14.52 AM.png" style="width: 376px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/30268i0110A10C090CD8BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-01-25 at 9.14.52 AM.png" alt="Screen Shot 2021-01-25 at 9.14.52 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This leaves you with two options:&lt;BR /&gt;1. Create flat json without the line returns.&lt;BR /&gt;2. Looking at result you are trying to achieve, design your NiFi EL differently:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-01-25 at 9.17.48 AM.png" style="width: 621px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/30269i0612E16D2BA478DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-01-25 at 9.17.48 AM.png" alt="Screen Shot 2021-01-25 at 9.17.48 AM.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Note proper NiFi EL highlighting above.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Matt&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 14:19:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Expression-language-ifelse-in-ReplaceText-processor/m-p/310376#M224130</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2021-01-25T14:19:17Z</dc:date>
    </item>
  </channel>
</rss>

