<?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>topic Blue Prism JSON to Collection Transformation in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100823#M47973</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Looking to transform a API response in JSON format to a collection but have encountered an issue with the JSON format and JSON to Collection action. &lt;BR /&gt;&lt;BR /&gt;The first JSON field is an index that converts to new columns in a collection, each response could have 0 to 100 items so i am looking to dynamically iterate through these to extract the required data into a structured collection, but i cannot find a viable solution.&lt;BR /&gt;&lt;BR /&gt;so far i have tested:&lt;BR /&gt;1. iterate through each column and extract using 'Collection Utility'.'Read Collection Field', this errors when attempting to access the subcollections using a dynamic field name&lt;BR /&gt;2. Regex Match, the only regex action available to myself matches only the first instance, not each occurrence.&lt;BR /&gt;3. Javascript to rename JSON Index to a static value to create rows instead of columns, unfortunately my Javascript knowledge is not sufficient at the moment to build this, but am working on this as my current solution&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;JSON Example:&lt;BR /&gt;{&lt;BR /&gt;"0":[{DATA}],&lt;BR /&gt;"1":[{DATA}]&lt;BR /&gt;}&lt;BR /&gt;Collection Generated;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36571.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36581iEBE67DF4949BA673/image-size/large?v=v2&amp;amp;px=999" role="button" title="36571.png" alt="36571.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated, happy to provide any further information if required &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Sun, 14 Aug 2022 15:05:55 GMT</pubDate>
    <dc:creator>ConnorJenkins</dc:creator>
    <dc:date>2022-08-14T15:05:55Z</dc:date>
    <item>
      <title>Blue Prism JSON to Collection Transformation</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100823#M47973</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Looking to transform a API response in JSON format to a collection but have encountered an issue with the JSON format and JSON to Collection action. &lt;BR /&gt;&lt;BR /&gt;The first JSON field is an index that converts to new columns in a collection, each response could have 0 to 100 items so i am looking to dynamically iterate through these to extract the required data into a structured collection, but i cannot find a viable solution.&lt;BR /&gt;&lt;BR /&gt;so far i have tested:&lt;BR /&gt;1. iterate through each column and extract using 'Collection Utility'.'Read Collection Field', this errors when attempting to access the subcollections using a dynamic field name&lt;BR /&gt;2. Regex Match, the only regex action available to myself matches only the first instance, not each occurrence.&lt;BR /&gt;3. Javascript to rename JSON Index to a static value to create rows instead of columns, unfortunately my Javascript knowledge is not sufficient at the moment to build this, but am working on this as my current solution&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;JSON Example:&lt;BR /&gt;{&lt;BR /&gt;"0":[{DATA}],&lt;BR /&gt;"1":[{DATA}]&lt;BR /&gt;}&lt;BR /&gt;Collection Generated;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36571.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36581iEBE67DF4949BA673/image-size/large?v=v2&amp;amp;px=999" role="button" title="36571.png" alt="36571.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated, happy to provide any further information if required &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sun, 14 Aug 2022 15:05:55 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100823#M47973</guid>
      <dc:creator>ConnorJenkins</dc:creator>
      <dc:date>2022-08-14T15:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Blue Prism JSON to Collection Transformation</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100824#M47974</link>
      <description>Hi &lt;A class="user-content-mention" data-sign="@" data-contactkey="e8278bb9-5540-4872-8e7e-45240097f6ba" data-tag-text="@Connor Jenkins" href="https://community.blueprism.com/network/profile?UserKey=e8278bb9-5540-4872-8e7e-45240097f6ba" data-itemmentionkey="0283d923-7445-47f9-930d-c8decaa4dd5c"&gt;@Connor Jenkins&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;To undestand better the problem. In your JSON example, when you say "DATA" you mean you have to really like this:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;{&lt;BR /&gt;  "0": {&lt;BR /&gt;    "field1": "0_value1",&lt;BR /&gt;    "field2": "0_value2",&lt;BR /&gt;    "field3": "0_value3"&lt;BR /&gt;  },&lt;BR /&gt;  "1": {&lt;BR /&gt;    "field1": "1_value1",&lt;BR /&gt;    "field2": "1_value2",&lt;BR /&gt;    "field3": "1_value3"&lt;BR /&gt;  }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;And you want to know (for example) which collection has a specific value in its "field1"?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or directly, DATA means only one value per item?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;See you in the Community, bye &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sun, 14 Aug 2022 18:51:55 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100824#M47974</guid>
      <dc:creator>PabloSarabia</dc:creator>
      <dc:date>2022-08-14T18:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Blue Prism JSON to Collection Transformation</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100825#M47975</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/66"&gt;@PabloSarabia&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you for your response, I have added below more information on the JSON format and the final collection i am trying to create from it&lt;BR /&gt;&lt;BR /&gt;​Expanded JSON:&lt;BR /&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;{
  "0": [
    {
      "address": "Address1",
      "postcode": "PostCode1",
      "additional": {
        "Field1": "Data1",
        "Field2": "Data2"
      }
    }
  ],
  "1": [
    {
      "address": "Address2",
      "postcode": "PostCode2",
      "additional": {
        "Field1": "Data1",
        "Field2": "Data2"
      }
    }
  ]
}​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Final Output collection, aware it will require manipulation and iteration to produce this with the dynamic JSON length;&lt;/P&gt;
&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="280" style="border-collapse: collapse; width: 212pt;"&gt;
&lt;TBODY&gt;
&lt;TR height="19" style="height: 14.4pt;"&gt;
&lt;TD height="19" class="xl63" style="height: 14.4pt; width: 70.1625px;"&gt;Address&lt;/TD&gt;
&lt;TD class="xl63" style="width: 86.2px;"&gt;Postcode&lt;/TD&gt;
&lt;TD class="xl63" style="width: 57.125px;"&gt;Field1&lt;/TD&gt;
&lt;TD class="xl63" style="width: 68.175px;"&gt;Field2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR height="19" style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt; width: 70.1625px;"&gt;Address1&lt;/TD&gt;
&lt;TD style="width: 86.2px;"&gt;PostCode1&lt;/TD&gt;
&lt;TD style="width: 57.125px;"&gt;Data1&lt;/TD&gt;
&lt;TD style="width: 68.175px;"&gt;Data2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR height="19" style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt; width: 70.1625px;"&gt;Address2&lt;/TD&gt;
&lt;TD style="width: 86.2px;"&gt;PostCode2&lt;/TD&gt;
&lt;TD style="width: 57.125px;"&gt;Data1&lt;/TD&gt;
&lt;TD style="width: 68.175px;"&gt;Data2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Sun, 14 Aug 2022 20:05:58 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100825#M47975</guid>
      <dc:creator>ConnorJenkins</dc:creator>
      <dc:date>2022-08-14T20:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Blue Prism JSON to Collection Transformation</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100826#M47976</link>
      <description>Hi, &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/66"&gt;@PabloSarabia&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you so much for the VBO, the code below makes sense including how to add further fields. I will need to check the governance within my team before I can import and test the VBO but dont forsee any issues with it. &lt;BR /&gt;&lt;BR /&gt;In the case that I am not permitted to use a custom VBO, is it possible to execute this code within ​a process action without importing the VBO?&lt;BR /&gt;&lt;BR /&gt;Really appreciate your help with this :)​​</description>
      <pubDate>Mon, 15 Aug 2022 10:47:20 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100826#M47976</guid>
      <dc:creator>ConnorJenkins</dc:creator>
      <dc:date>2022-08-15T10:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Blue Prism JSON to Collection Transformation</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100827#M47977</link>
      <description>Hi &lt;A class="user-content-mention" data-sign="@" data-contactkey="e8278bb9-5540-4872-8e7e-45240097f6ba" data-tag-text="@Connor Jenkins" href="https://community.blueprism.com/network/profile?UserKey=e8278bb9-5540-4872-8e7e-45240097f6ba" data-itemmentionkey="3abe1a5b-e573-4c1c-8536-af04d9e27c98"&gt;@Connor Jenkins&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Yes, you can use the piece of code with out importing this VBO. Include it in one of your owns VBO and it should work.&lt;BR /&gt;&lt;BR /&gt;Just in case, I try to make all of this logic with only BP stages. But I think is impossible. The first problem that you face with is when you need to read all the columns, cause the action that you mentioned before, "Get Collection Field" allways returns you a text value. (It gives you an error cause has a string cast inside)&lt;BR /&gt;&lt;BR /&gt;I think there might be a possibility to make a loop that deletes the columns of the collection or something similar, but it would be quite inefficient.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;See you in the Community, bye &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 15 Aug 2022 11:04:04 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100827#M47977</guid>
      <dc:creator>PabloSarabia</dc:creator>
      <dc:date>2022-08-15T11:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Blue Prism JSON to Collection Transformation</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100828#M47978</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;The object you shared in this thread. does not have any action.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Ahmed B.</description>
      <pubDate>Wed, 12 Oct 2022 18:31:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-JSON-to-Collection-Transformation/m-p/100828#M47978</guid>
      <dc:creator>AhmedBasheer_M</dc:creator>
      <dc:date>2022-10-12T18:31:00Z</dc:date>
    </item>
  </channel>
</rss>

