<?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 Apache NiFi. ConvertRecord XML to JSON. interpret all values as text in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392699#M248213</link>
    <description>&lt;P&gt;Hi all!&lt;BR /&gt;&lt;BR /&gt;i faced out with the problem.&lt;BR /&gt;I need to convert xml file to json.&lt;BR /&gt;here is my flow&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moshell281_0-1724848662183.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41566i79D206C15FBD44F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moshell281_0-1724848662183.png" alt="moshell281_0-1724848662183.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moshell281_1-1724848692878.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41567i265A53C8D4B4A48C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moshell281_1-1724848692878.png" alt="moshell281_1-1724848692878.png" /&gt;&lt;/span&gt;&lt;BR /&gt;ConvertRecord&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moshell281_2-1724848729150.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41568i4037114EF82AAE00/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moshell281_2-1724848729150.png" alt="moshell281_2-1724848729150.png" /&gt;&lt;/span&gt;&lt;BR /&gt;XMLReader&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moshell281_3-1724848805804.png" style="width: 406px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41569i1C3E70DA52F66A05/image-dimensions/406x289?v=v2" width="406" height="289" role="button" title="moshell281_3-1724848805804.png" alt="moshell281_3-1724848805804.png" /&gt;&lt;/span&gt;&lt;BR /&gt;JsonRecordSetWritter&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Everything is ok, but the problem is in convetring digit-values&lt;BR /&gt;&lt;BR /&gt;for example&lt;BR /&gt;xml data&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;document_code&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    &amp;lt;code&amp;gt;000&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/document_code&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;converted to&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"document_code": {
  "code": 0
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;another one is:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;service-code&amp;gt;&lt;/SPAN&gt;0012388833456&lt;SPAN&gt;&amp;lt;/service-code&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;converted to&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"service-code": 12388833456&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;this is critical data, so i want Ni-Fi to convert them as string.&lt;BR /&gt;all values as string - is what i need.&lt;BR /&gt;&lt;BR /&gt;Help please.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 12:56:29 GMT</pubDate>
    <dc:creator>moshell281</dc:creator>
    <dc:date>2024-08-28T12:56:29Z</dc:date>
    <item>
      <title>Apache NiFi. ConvertRecord XML to JSON. interpret all values as text</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392699#M248213</link>
      <description>&lt;P&gt;Hi all!&lt;BR /&gt;&lt;BR /&gt;i faced out with the problem.&lt;BR /&gt;I need to convert xml file to json.&lt;BR /&gt;here is my flow&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moshell281_0-1724848662183.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41566i79D206C15FBD44F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moshell281_0-1724848662183.png" alt="moshell281_0-1724848662183.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moshell281_1-1724848692878.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41567i265A53C8D4B4A48C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moshell281_1-1724848692878.png" alt="moshell281_1-1724848692878.png" /&gt;&lt;/span&gt;&lt;BR /&gt;ConvertRecord&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moshell281_2-1724848729150.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41568i4037114EF82AAE00/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moshell281_2-1724848729150.png" alt="moshell281_2-1724848729150.png" /&gt;&lt;/span&gt;&lt;BR /&gt;XMLReader&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moshell281_3-1724848805804.png" style="width: 406px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41569i1C3E70DA52F66A05/image-dimensions/406x289?v=v2" width="406" height="289" role="button" title="moshell281_3-1724848805804.png" alt="moshell281_3-1724848805804.png" /&gt;&lt;/span&gt;&lt;BR /&gt;JsonRecordSetWritter&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Everything is ok, but the problem is in convetring digit-values&lt;BR /&gt;&lt;BR /&gt;for example&lt;BR /&gt;xml data&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;document_code&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    &amp;lt;code&amp;gt;000&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/document_code&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;converted to&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"document_code": {
  "code": 0
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;another one is:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;service-code&amp;gt;&lt;/SPAN&gt;0012388833456&lt;SPAN&gt;&amp;lt;/service-code&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;converted to&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"service-code": 12388833456&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;this is critical data, so i want Ni-Fi to convert them as string.&lt;BR /&gt;all values as string - is what i need.&lt;BR /&gt;&lt;BR /&gt;Help please.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 12:56:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392699#M248213</guid>
      <dc:creator>moshell281</dc:creator>
      <dc:date>2024-08-28T12:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi. ConvertRecord XML to JSON. interpret all values as text</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392721#M248224</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82206"&gt;@moshell281&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/95503"&gt;@steven-matison&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105558"&gt;@joseomjr&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 18:00:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392721#M248224</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-08-28T18:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi. ConvertRecord XML to JSON. interpret all values as text</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392767#M248243</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82206"&gt;@moshell281&lt;/a&gt;&amp;nbsp; &amp;nbsp;This is indeed a very tough solution to solve.&amp;nbsp; &amp;nbsp;The only thing that comes to mind is creating your own schema, versus inferring the schema.&amp;nbsp; Creating that schema from scratch could be a long task.&amp;nbsp; So one trick you can do would be to run the flow to infer the schema, and configure the controller service to write that schema to an attribute.&amp;nbsp; &amp;nbsp;Inspect a flowfile and grab that schema.&amp;nbsp; &amp;nbsp;Next modify the schema to suit your needs, and then modify and test the flow with the specified schema (no longer inferred).&amp;nbsp; &amp;nbsp;This should allow you control to specify the correct data type for "000" so it is not assumed to be "0".&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 12:14:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392767#M248243</guid>
      <dc:creator>steven-matison</dc:creator>
      <dc:date>2024-08-29T12:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi. ConvertRecord XML to JSON. interpret all values as text</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392853#M248273</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82206"&gt;@moshell281&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/95503"&gt;@steven-matison&lt;/a&gt;is right, when you use infer schema&amp;nbsp; the processor will map the value as it thinks the data type should be, so if it sees an integer it will map to an integer and so on. To force certain datatypes you have to define your own Avro schema and feed it to the Json Record Set Writer since this is your target format. If you are not comfortable working with Avro schema then you can use UpdateRecord or even JsonJoltTransformation processors to cast the value into the proper type.&lt;/P&gt;&lt;P&gt;Hope you find this helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 12:54:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/392853#M248273</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-08-30T12:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi. ConvertRecord XML to JSON. interpret all values as text</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/393378#M248432</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82206"&gt;@moshell281&lt;/a&gt;&amp;nbsp;Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 13:17:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-ConvertRecord-XML-to-JSON-interpret-all-values/m-p/393378#M248432</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-09-11T13:17:02Z</dc:date>
    </item>
  </channel>
</rss>

