<?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: Building JSON object for invoke-http in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361280#M238550</link>
    <description>&lt;P&gt;Ok, I understand now what you are doing. The problem is that you are trying to merge information from one FlowFile to another, and this can't be done in the way you designed. Two FlowFiles mean &lt;STRONG&gt;two separate processes&lt;/STRONG&gt;, they &lt;U&gt;don't communicate with one another&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to use one single FlowFile for the entire process if you need information from both the JSON and XML. I suggest putting the &lt;FONT color="#0000FF"&gt;EvaluateXPath&lt;/FONT&gt; after the &lt;FONT color="#0000FF"&gt;UpdateAttributes&lt;/FONT&gt; processor, setting the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Destination&lt;/STRONG&gt; property to "&lt;STRONG&gt;flowfile-attribute&lt;/STRONG&gt;" in a way you will have all the attributes in the same flowfile (&lt;EM&gt;titlefromXML,&amp;nbsp;guid,&amp;nbsp;Contact Name, caseno, and docno&lt;/EM&gt;) to use in the JOLT specification.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;I&gt;--&lt;BR /&gt;Was your question answered? Please take some time to click on "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" below this post.&lt;BR /&gt;If you find a reply useful, say thanks by clicking on the thumbs up button.&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2023 11:26:57 GMT</pubDate>
    <dc:creator>linssab</dc:creator>
    <dc:date>2023-01-13T11:26:57Z</dc:date>
    <item>
      <title>Building JSON object for invoke-http</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361128#M238517</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm looking at using Apache Nifi as a data integration hub for our case/archive management solution used in the Nordics and our rest-based API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One use case is to first read an XML from one source with a few values and then use these values in a larger JSON payload that creates a new case in our solution with InvokeHTTP.&lt;/P&gt;&lt;P&gt;All values in the JSON arrays are inside a parameter{} node and can have objects with child properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done a lot of research and testing with the different processors, like ReplaceText, and AttributesToJSON, but can't find how I easily can do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it needed to use some complex JSON generator like Groovy or Jolt to achieve this with ExecuteScript?&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;With a online tool like make.com I was able to do this really easy, but find it complex to just replace multiple single values in the JSON payload before InvokeHHTP when the JSON payload is nested.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of a JSON payload for the API can be something like below, but can also contain many other values and nested objects. I want to replace a few of these values, like those in &lt;STRONG&gt;&amp;lt;bold&amp;gt; &lt;/STRONG&gt;with values/parameters from the XML input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"parameter"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;D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p;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you for any pointers!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Willy T. Koch&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Norway&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jan 2023 10:59:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361128#M238517</guid>
      <dc:creator>willytk</dc:creator>
      <dc:date>2023-01-12T10:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Building JSON object for invoke-http</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361154#M238521</link>
      <description>&lt;P&gt;You have a few options here. Replace text could do the trick with some regex expression but it can get quite complex. I would suggest you use the &lt;FONT color="#0000FF"&gt;JoltTransformJSON &lt;FONT color="#000000"&gt;processor.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="linssab_0-1673534871175.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36601i9EB73C4F0C5D7980/image-size/medium?v=v2&amp;amp;px=400" role="button" title="linssab_0-1673534871175.png" alt="linssab_0-1673534871175.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;The follow &lt;U&gt;JOLT Specification&lt;/U&gt; will work for you considering your flowfile have the &lt;STRONG&gt;title&lt;/STRONG&gt;, &lt;STRONG&gt;id&lt;/STRONG&gt;, and &lt;STRONG&gt;contact-name&lt;/STRONG&gt; attributes. Replace accordingly.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "parameter": {
        "Title": "${title}",
        "ExternalId": { "Id": "${id}" }
      }
    }
  },
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "*": {
        "UnregisteredContacts": { "[1]": { "ContactName": "${contact-name}" } }
      }
    }
}
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 14:48:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361154#M238521</guid>
      <dc:creator>linssab</dc:creator>
      <dc:date>2023-01-12T14:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Building JSON object for invoke-http</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361197#M238531</link>
      <description>&lt;P&gt;Perfect, thank you! That was as simple as I'd hoped &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I just need to get the properties from another flowfile that reads an XML file, uses &lt;STRONG&gt;EvaluateXPath&lt;/STRONG&gt; to set some new parameters, like&amp;nbsp;&lt;EM&gt;caseno&lt;/EM&gt;, &lt;EM&gt;docno&lt;/EM&gt; which will be used in the &lt;STRONG&gt;Invoke-HTTP&lt;/STRONG&gt; request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the trick on getting only those properties into the scope of the &lt;STRONG&gt;JoltTransformJSON&lt;/STRONG&gt; object so I can use them in the JSON payload for Invoke-HTTP?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried some variants of &lt;STRONG&gt;AttributesToJSON&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;MergeContent&lt;/STRONG&gt;, but can't seem to only get the properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Willy&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 06:26:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361197#M238531</guid>
      <dc:creator>willytk</dc:creator>
      <dc:date>2023-01-13T06:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Building JSON object for invoke-http</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361254#M238538</link>
      <description>&lt;P&gt;Hey Willy,&lt;/P&gt;&lt;P&gt;I'm glad I was able to help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the properties, I'm assuming you meant &lt;EM&gt;attributes.&amp;nbsp;&lt;/EM&gt;The&amp;nbsp;&lt;FONT color="#0000FF"&gt;JoltTransformJSON&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&lt;/FONT&gt;supports Expression Language (EL) with Variable Registry and FlowFile attributes. This means you can access any &lt;EM&gt;attribute&lt;/EM&gt; in your flowfile with EL syntax, as&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${attributeName}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your flowfile (that reads the XML file)&amp;nbsp;&lt;STRONG&gt;Content&amp;nbsp;&lt;/STRONG&gt;is a JSON, you can extract values from the JSON and turn them into a&lt;EM&gt;ttributes&amp;nbsp;&lt;/EM&gt;with the &lt;FONT color="#0000FF"&gt;EvaluateJsonPath&lt;/FONT&gt; processor as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="linssab_0-1673601006469.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36605i054FAFF69E12D505/image-size/medium?v=v2&amp;amp;px=400" role="button" title="linssab_0-1673601006469.png" alt="linssab_0-1673601006469.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then you can use these attributes in the JoltTransform with the syntax written above.&lt;/P&gt;&lt;P&gt;However, if the flowfile content is not a JSON and&amp;nbsp;&lt;FONT color="#0000FF"&gt;EvaluateJsonPath&lt;/FONT&gt;&amp;nbsp;does not serve the purpose, you can try extracting the information within the FlowFile and turn them into &lt;EM&gt;attributes&amp;nbsp;&lt;/EM&gt;using the &lt;FONT color="#0000FF"&gt;ExtractText&lt;FONT color="#0000FF"&gt; &lt;FONT color="#000000"&gt;processor.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;Let's say teh XLM FLowFile content is:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;property1="FieldValue1"&amp;gt; 
    &amp;lt;caseno="foobar"&amp;gt;
&amp;lt;property2="FieldValue2"&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;You can use the syntax below to extract the caseno field and set it as an &lt;EM&gt;attribute&lt;/EM&gt; in the FlowFile&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;caseno=\s*"(\w+)"&lt;/LI-CODE&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="linssab_1-1673602033370.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36606i78301B6066CECD82/image-size/medium?v=v2&amp;amp;px=400" role="button" title="linssab_1-1673602033370.png" alt="linssab_1-1673602033370.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;--&lt;BR /&gt;Was your question answered? Please take some time to click on "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" below this post.&lt;BR /&gt;If you find a reply useful, say thanks by clicking on the thumbs up button.&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 10:44:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361254#M238538</guid>
      <dc:creator>linssab</dc:creator>
      <dc:date>2023-01-13T10:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Building JSON object for invoke-http</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361272#M238545</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks, but it doesn't quite cover what I meant.&lt;/P&gt;&lt;P&gt;Yes, I meant properties and I understand the use of EL with that ${} syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that I have two FlowFiles, one with the JSON request as first mentioned which is the basis for the Invoke-HTTP payload, but where I need to replace some of the values from another source/FlowFile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The values are read from another FlowFile, which is XML content and I have succesfully extracted the values I need from that as properties using &lt;STRONG&gt;EvaluateXPath, &lt;/STRONG&gt;like&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="willytk_1-1673606377844.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36608i092F21AE8D6790B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="willytk_1-1673606377844.png" alt="willytk_1-1673606377844.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I don't understand is how to get the XML-mapped properties from FlowFile (XML) into the FlowFile (JSON) so I can use them in JoltTransformJSON&lt;/P&gt;&lt;P&gt;Here's the flow, which currently fails since it's trying to to merge the XML in the Content, which is no longer needed. I only need the mapped properties from the XML flow in the right-side flow, so they can be used in the left JoltTransformJSON process and used for the final Invoke-HTTP.&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="willytk_2-1673606835596.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36609i0842BB032798187B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="willytk_2-1673606835596.png" alt="willytk_2-1673606835596.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Willy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 10:47:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361272#M238545</guid>
      <dc:creator>willytk</dc:creator>
      <dc:date>2023-01-13T10:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Building JSON object for invoke-http</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361280#M238550</link>
      <description>&lt;P&gt;Ok, I understand now what you are doing. The problem is that you are trying to merge information from one FlowFile to another, and this can't be done in the way you designed. Two FlowFiles mean &lt;STRONG&gt;two separate processes&lt;/STRONG&gt;, they &lt;U&gt;don't communicate with one another&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to use one single FlowFile for the entire process if you need information from both the JSON and XML. I suggest putting the &lt;FONT color="#0000FF"&gt;EvaluateXPath&lt;/FONT&gt; after the &lt;FONT color="#0000FF"&gt;UpdateAttributes&lt;/FONT&gt; processor, setting the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Destination&lt;/STRONG&gt; property to "&lt;STRONG&gt;flowfile-attribute&lt;/STRONG&gt;" in a way you will have all the attributes in the same flowfile (&lt;EM&gt;titlefromXML,&amp;nbsp;guid,&amp;nbsp;Contact Name, caseno, and docno&lt;/EM&gt;) to use in the JOLT specification.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;I&gt;--&lt;BR /&gt;Was your question answered? Please take some time to click on "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" below this post.&lt;BR /&gt;If you find a reply useful, say thanks by clicking on the thumbs up button.&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 11:26:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Building-JSON-object-for-invoke-http/m-p/361280#M238550</guid>
      <dc:creator>linssab</dc:creator>
      <dc:date>2023-01-13T11:26:57Z</dc:date>
    </item>
  </channel>
</rss>

