<?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: Problem with update attribute in NIFI in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Problem-with-update-attribute-in-NIFI/m-p/373812#M241752</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105912"&gt;@MWM&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your description is not super clear to me.&lt;BR /&gt;FlowFile Attributes are in format of &amp;lt;attribute name&amp;gt;=&amp;lt;attribute value&amp;gt;&lt;BR /&gt;example key=value FlowFile attributes:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Attribute name = Attribute value
name=toyota
type=car&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Here is how I interpret what you have provided:&lt;BR /&gt;- You have a FlowFile that has a custom FlowFile "Attribute Name" on it "name".&lt;BR /&gt;- That "name" Attribute has no value associated to it. (name = )&lt;BR /&gt;&lt;BR /&gt;The UpdateAttribute processor allows you to add new key=value (attribute name = attribute value) attribute pairs to an existing FlowFile or modify the value of an existing FlowFile Attribute Name.&lt;BR /&gt;You can NOT create a new attribute and then modify or use that new attribute within the same processor in which it was created.&lt;BR /&gt;&lt;BR /&gt;Lets say you have a FlowFile with the example FlowFile attributes and values I shared above.&lt;BR /&gt;Then you use the UpdateAttribute processor to change the value on the Attribute "name" to all uppercase.&lt;BR /&gt;The &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html" target="_self"&gt;NiFi Expression Language (NEL)&lt;/A&gt; statement you created:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${name:toUpper()}&lt;/LI-CODE&gt;&lt;P&gt;will take the subject "name" and return it's value "toyota".&amp;nbsp; That returned value is passed to the toUpper() NEL function which converts the it to Uppercase "TOYOTA".&amp;nbsp; The resulting value is then written to the FlowFile attribute defined in the UpdateAttribute processor. Assuming an UpdateAttribute processor configured as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1689168412724.png" style="width: 686px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37991i3D1758A747D2FB70/image-dimensions/686x480?v=v2" width="686" height="480" role="button" title="MattWho_0-1689168412724.png" alt="MattWho_0-1689168412724.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The NEL expression resulting a new value of "TOYOTA" would be written to the FlowFile Attribute "name" since "name" already exists as an attribute on the FlowFile, its current attribute value of "toyota" would be replaced with new value "TOYOTA".&lt;BR /&gt;&lt;BR /&gt;Hope this helps clarify how NiFi FlowFile Attributes and the UpdateAttribute processor is used.&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic"&gt;If you found that the provided solution(s) assisted you with your query, please take a moment to login and click&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;Accept as Solution&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;below each response that helped.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;Matt&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2023 13:30:15 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2023-07-12T13:30:15Z</dc:date>
    <item>
      <title>Problem with update attribute in NIFI</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Problem-with-update-attribute-in-NIFI/m-p/373804#M241746</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;hello, &lt;BR /&gt;I have the following problem - &lt;BR /&gt;I have a flow and I have a name attribute in it, I need to change it to uppercase. &lt;BR /&gt;I used UpdateAtribute processor for this, as property I have name and as vaule I have:${name:toUpper()}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;unfortunately it doesn't work and now instead of having name in capital letters I have Empty string set, anyone know why this is happening?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 11:34:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Problem-with-update-attribute-in-NIFI/m-p/373804#M241746</guid>
      <dc:creator>MWM</dc:creator>
      <dc:date>2023-07-12T11:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with update attribute in NIFI</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Problem-with-update-attribute-in-NIFI/m-p/373808#M241749</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could you please check right before UpdateAttribute Processor, if the attribute "name" is filled with your expected content?&lt;/P&gt;&lt;P&gt;Normally it is correct what you explain - maybe you loose somewhere after merge, wait/notify, ... your attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 12:38:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Problem-with-update-attribute-in-NIFI/m-p/373808#M241749</guid>
      <dc:creator>Faerballert</dc:creator>
      <dc:date>2023-07-12T12:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with update attribute in NIFI</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Problem-with-update-attribute-in-NIFI/m-p/373812#M241752</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105912"&gt;@MWM&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your description is not super clear to me.&lt;BR /&gt;FlowFile Attributes are in format of &amp;lt;attribute name&amp;gt;=&amp;lt;attribute value&amp;gt;&lt;BR /&gt;example key=value FlowFile attributes:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Attribute name = Attribute value
name=toyota
type=car&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Here is how I interpret what you have provided:&lt;BR /&gt;- You have a FlowFile that has a custom FlowFile "Attribute Name" on it "name".&lt;BR /&gt;- That "name" Attribute has no value associated to it. (name = )&lt;BR /&gt;&lt;BR /&gt;The UpdateAttribute processor allows you to add new key=value (attribute name = attribute value) attribute pairs to an existing FlowFile or modify the value of an existing FlowFile Attribute Name.&lt;BR /&gt;You can NOT create a new attribute and then modify or use that new attribute within the same processor in which it was created.&lt;BR /&gt;&lt;BR /&gt;Lets say you have a FlowFile with the example FlowFile attributes and values I shared above.&lt;BR /&gt;Then you use the UpdateAttribute processor to change the value on the Attribute "name" to all uppercase.&lt;BR /&gt;The &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html" target="_self"&gt;NiFi Expression Language (NEL)&lt;/A&gt; statement you created:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${name:toUpper()}&lt;/LI-CODE&gt;&lt;P&gt;will take the subject "name" and return it's value "toyota".&amp;nbsp; That returned value is passed to the toUpper() NEL function which converts the it to Uppercase "TOYOTA".&amp;nbsp; The resulting value is then written to the FlowFile attribute defined in the UpdateAttribute processor. Assuming an UpdateAttribute processor configured as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1689168412724.png" style="width: 686px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37991i3D1758A747D2FB70/image-dimensions/686x480?v=v2" width="686" height="480" role="button" title="MattWho_0-1689168412724.png" alt="MattWho_0-1689168412724.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The NEL expression resulting a new value of "TOYOTA" would be written to the FlowFile Attribute "name" since "name" already exists as an attribute on the FlowFile, its current attribute value of "toyota" would be replaced with new value "TOYOTA".&lt;BR /&gt;&lt;BR /&gt;Hope this helps clarify how NiFi FlowFile Attributes and the UpdateAttribute processor is used.&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic"&gt;If you found that the provided solution(s) assisted you with your query, please take a moment to login and click&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;Accept as Solution&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;below each response that helped.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;Matt&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 13:30:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Problem-with-update-attribute-in-NIFI/m-p/373812#M241752</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2023-07-12T13:30:15Z</dc:date>
    </item>
  </channel>
</rss>

