<?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 how to send dictionary in invoke http processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-send-dictionary-in-invoke-http-processor/m-p/297365#M218662</link>
    <description>&lt;P class="lia-align-left"&gt;hi everyone ,&lt;/P&gt;&lt;P&gt;We want to put data in web app using API endpoint&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://localhost:8000/api/event/${id}/attributes" target="_blank" rel="noopener"&gt;https://localhost:8000/api/event/${id}/attributes&lt;/A&gt;&amp;nbsp;this is the API endpoint that i have used in invoke HTTP processor in Remote URL field with &lt;STRONG&gt;PUT&lt;/STRONG&gt; method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;we want to create new attribute with value and this attribute is a dictionary type so we have to pass the data in the dictionary format for this we have used updateattribute processor and attributetojson processor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;updateAttribute processor snap&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="renuu_0-1591268658480.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27885i2A24B69B4B680832/image-size/medium?v=v2&amp;amp;px=400" role="button" title="renuu_0-1591268658480.png" alt="renuu_0-1591268658480.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Attributetojson processor snap&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="renuu_1-1591268717755.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27886i041D5791612571F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="renuu_1-1591268717755.png" alt="renuu_1-1591268717755.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and the below is out of attributetoJson processor (flowfile)&lt;/P&gt;&lt;P&gt;{"note":"note from nifi","attributes":"{\n \"workflow\":\"process\"\n }","id":"1ecfbcbb-38bf-49e9-a77e-a88w"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the error msg in invoke http processor&amp;nbsp;&lt;/P&gt;&lt;DIV class="attribute-value"&gt;{ "code": 500, "errors": [ "Traceback (most recent call last):\n File \"/usr/local/lib/python3.6/site-packages/flask/app.py\", line 1949, in full_dispatch_request\n rv = self.dispatch_request()\n File \"/usr/local/lib/python3.6/site-packages/&lt;/DIV&gt;&lt;DIV class="unset"&gt;&lt;SPAN class="unset"&gt;No value set&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="unset"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="unset"&gt;as per my knowledge this is type error. I think the Dictionary is not sending in correct format . i have also used&amp;nbsp;${attributes:unescapeJson()} in updateAttribute ...but i think i have made a mistake in the declaration&lt;/DIV&gt;&lt;DIV class="unset"&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;property_name&lt;/TD&gt;&lt;TD width="50%"&gt;property_value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;attributes&lt;/TD&gt;&lt;TD width="50%"&gt;{"workflow": "process"}&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;'attributes'&amp;nbsp;&lt;/TD&gt;&lt;TD width="50%"&gt;${attributes:unescapeJson()}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class="unset"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="unset"&gt;&amp;nbsp;thanks&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2020 11:19:42 GMT</pubDate>
    <dc:creator>renuu</dc:creator>
    <dc:date>2020-06-04T11:19:42Z</dc:date>
    <item>
      <title>how to send dictionary in invoke http processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-send-dictionary-in-invoke-http-processor/m-p/297365#M218662</link>
      <description>&lt;P class="lia-align-left"&gt;hi everyone ,&lt;/P&gt;&lt;P&gt;We want to put data in web app using API endpoint&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://localhost:8000/api/event/${id}/attributes" target="_blank" rel="noopener"&gt;https://localhost:8000/api/event/${id}/attributes&lt;/A&gt;&amp;nbsp;this is the API endpoint that i have used in invoke HTTP processor in Remote URL field with &lt;STRONG&gt;PUT&lt;/STRONG&gt; method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;we want to create new attribute with value and this attribute is a dictionary type so we have to pass the data in the dictionary format for this we have used updateattribute processor and attributetojson processor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;updateAttribute processor snap&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="renuu_0-1591268658480.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27885i2A24B69B4B680832/image-size/medium?v=v2&amp;amp;px=400" role="button" title="renuu_0-1591268658480.png" alt="renuu_0-1591268658480.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Attributetojson processor snap&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="renuu_1-1591268717755.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27886i041D5791612571F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="renuu_1-1591268717755.png" alt="renuu_1-1591268717755.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and the below is out of attributetoJson processor (flowfile)&lt;/P&gt;&lt;P&gt;{"note":"note from nifi","attributes":"{\n \"workflow\":\"process\"\n }","id":"1ecfbcbb-38bf-49e9-a77e-a88w"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the error msg in invoke http processor&amp;nbsp;&lt;/P&gt;&lt;DIV class="attribute-value"&gt;{ "code": 500, "errors": [ "Traceback (most recent call last):\n File \"/usr/local/lib/python3.6/site-packages/flask/app.py\", line 1949, in full_dispatch_request\n rv = self.dispatch_request()\n File \"/usr/local/lib/python3.6/site-packages/&lt;/DIV&gt;&lt;DIV class="unset"&gt;&lt;SPAN class="unset"&gt;No value set&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="unset"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="unset"&gt;as per my knowledge this is type error. I think the Dictionary is not sending in correct format . i have also used&amp;nbsp;${attributes:unescapeJson()} in updateAttribute ...but i think i have made a mistake in the declaration&lt;/DIV&gt;&lt;DIV class="unset"&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;property_name&lt;/TD&gt;&lt;TD width="50%"&gt;property_value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;attributes&lt;/TD&gt;&lt;TD width="50%"&gt;{"workflow": "process"}&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;'attributes'&amp;nbsp;&lt;/TD&gt;&lt;TD width="50%"&gt;${attributes:unescapeJson()}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class="unset"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="unset"&gt;&amp;nbsp;thanks&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 11:19:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-send-dictionary-in-invoke-http-processor/m-p/297365#M218662</guid>
      <dc:creator>renuu</dc:creator>
      <dc:date>2020-06-04T11:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to send dictionary in invoke http processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-send-dictionary-in-invoke-http-processor/m-p/297381#M218670</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/78219"&gt;@renuu&lt;/a&gt;&amp;nbsp;You have to build the final values you want as separate key value pairs like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="UpdateAttribute" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27890i37D1D332FED2F077/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-06-04 at 8.20.05 AM.png" alt="UpdateAttribute" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;UpdateAttribute&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Next you will use these attributes &amp;nbsp;to create a json object attribute using AttributesToJson:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AttributesToJson flowfile-attribute" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27893iCB45AD81ED7C7D7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-06-04 at 8.27.46 AM.png" alt="AttributesToJson flowfile-attribute" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;AttributesToJson flowfile-attribute&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that, if you inspect the flowfile you will see the json object as JSONAttributes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FlowFile Attribute JSONAttributes" style="width: 712px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27891i0133FA8F53B8B849/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-06-04 at 8.22.00 AM.png" alt="FlowFile Attribute JSONAttributes" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;FlowFile Attribute JSONAttributes&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From here you can use it as ${JSONAttributes} or if you need it to be called ${attributes} you just use another UpdateAttribute:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-06-04 at 8.27.00 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/27892iA46FC36DBA09713D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-06-04 at 8.27.00 AM.png" alt="Screen Shot 2020-06-04 at 8.27.00 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 12:29:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-send-dictionary-in-invoke-http-processor/m-p/297381#M218670</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-06-04T12:29:05Z</dc:date>
    </item>
  </channel>
</rss>

