<?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: JSON File Update in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303302#M221494</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/60150"&gt;@stevenmatison&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, but I have to make a judgemental update in JSON.&amp;nbsp; As I explained in the example only id with a particular value will be updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please assist.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2020 07:27:59 GMT</pubDate>
    <dc:creator>ravi_sh_DS</dc:creator>
    <dc:date>2020-09-24T07:27:59Z</dc:date>
    <item>
      <title>JSON File Update</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303241#M221456</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have below JSON file with multiples image's details&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "images": [{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "id": "C2934",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "ds_folder_id": "759838458734"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "id": "C8343",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "folder_id": "3942879137986"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }]&lt;BR /&gt;}.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have id of the image and have to update the folder_id with some value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Example:&lt;/P&gt;&lt;P&gt;id is &lt;STRONG&gt;C8343&lt;/STRONG&gt; and the new folder_id is &lt;STRONG&gt;2984584735&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;then I have to update folder_id of the JSON file with new one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New JSON would be&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "images": [{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "id": "C2934",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "ds_folder_id": "759838458734"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "id": "C8343",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "folder_id": "2984584735"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }]&lt;BR /&gt;}.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me to perform above in NiFi.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 05:45:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303241#M221456</guid>
      <dc:creator>ravi_sh_DS</dc:creator>
      <dc:date>2020-09-23T05:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: JSON File Update</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303295#M221487</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/77175"&gt;@ravi_sh_DS&lt;/a&gt;&amp;nbsp;The solution you are looking for is UpdateRecord.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a great article with full info:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/Update-the-Contents-of-FlowFile-by-using-UpdateRecord/ta-p/248267" target="_blank"&gt;https://community.cloudera.com/t5/Community-Articles/Update-the-Contents-of-FlowFile-by-using-UpdateRecord/ta-p/248267&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Steven&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 23:50:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303295#M221487</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-09-23T23:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: JSON File Update</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303299#M221491</link>
      <description>&lt;P&gt;thanks !&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/60150"&gt;@stevenmatison&lt;/a&gt;&amp;nbsp;for the detailed explanation.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 04:59:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303299#M221491</guid>
      <dc:creator>ravi_sh_DS</dc:creator>
      <dc:date>2020-09-24T04:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: JSON File Update</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303302#M221494</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/60150"&gt;@stevenmatison&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, but I have to make a judgemental update in JSON.&amp;nbsp; As I explained in the example only id with a particular value will be updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please assist.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 07:27:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303302#M221494</guid>
      <dc:creator>ravi_sh_DS</dc:creator>
      <dc:date>2020-09-24T07:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: JSON File Update</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303319#M221504</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/77175"&gt;@ravi_sh_DS&lt;/a&gt;&amp;nbsp;This gets a bit high level, so forgive me, as I am not sure how you know which ID to change and what to change it too. &amp;nbsp; That said, your approach could be to use QueryRecord and find the match you want, then update that match with UpdateRecord. &amp;nbsp;You can also split the json image array with SplitJson, then use UpdateRecord as suggested above. &amp;nbsp; In either method depending on your Use Case when you split the records and process the splits separately you may need to rejoin them downstream.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some older methods useful here are SplitJson, EvaluateJson, UpdateAttribute, AttributeToJson, but the Query Update Records are now preferred as it is possible to do things more dynamically.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 12:56:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JSON-File-Update/m-p/303319#M221504</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-09-24T12:56:26Z</dc:date>
    </item>
  </channel>
</rss>

