<?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 Re: JSON to collection: store all items as text format in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121289#M53385</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/296"&gt;@sumire&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May i ask you, you dont even have any clue that what will be the name of the columns in collection?&lt;/P&gt;&lt;P&gt;Because if the columns are dynamic then we can create an assingment of the value using blue prism without knowing the column name.&lt;/P&gt;&lt;P&gt;My suggestion to create a collection with dynamic columns is this but without knowing the fields of the collection we can't assign the values,&lt;/P&gt;&lt;P&gt;1. Get fields of the collection after Json to collection&lt;/P&gt;&lt;P&gt;2. Loop the fields and use append field&amp;nbsp;(Text) to collection action to add a field into a Final collection&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nandhakumar_0-1751364711430.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/41141iA6061A8E92848CDC/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Nandhakumar_0-1751364711430.png" alt="Nandhakumar_0-1751364711430.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this way we can create the collection with fields which are coming via json. but without having the list of fields possible in a json response not possible to assign.&lt;/P&gt;&lt;P&gt;let me know your thoughts!&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jul 2025 10:12:22 GMT</pubDate>
    <dc:creator>Nandhakumar</dc:creator>
    <dc:date>2025-07-01T10:12:22Z</dc:date>
    <item>
      <title>JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121281#M53380</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to store all JSON items as text format in a collection, even if the value is only a number.&lt;/P&gt;&lt;P&gt;The items to be retrieved are not constant. Please share if you have any ideas.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 04:45:35 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121281#M53380</guid>
      <dc:creator>sumire</dc:creator>
      <dc:date>2025-07-01T04:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121285#M53383</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/296"&gt;@sumire&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Utility - JSON: JSON to Collection automatically identifies the data type of the columns of the collection from json. From there we can do the following for small volume of records,&lt;/P&gt;&lt;P&gt;1. Create a defined collection with text data type and assign the values from original collection by looping.&lt;/P&gt;&lt;P&gt;Is it possible for you to have defined collection? or collection fields are dynamic?&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 09:46:19 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121285#M53383</guid>
      <dc:creator>Nandhakumar</dc:creator>
      <dc:date>2025-07-01T09:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121286#M53384</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/399"&gt;@Nandhakumar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The collection fields are dynamic. So, I can not define the collection.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 09:50:17 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121286#M53384</guid>
      <dc:creator>sumire</dc:creator>
      <dc:date>2025-07-01T09:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121289#M53385</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/296"&gt;@sumire&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May i ask you, you dont even have any clue that what will be the name of the columns in collection?&lt;/P&gt;&lt;P&gt;Because if the columns are dynamic then we can create an assingment of the value using blue prism without knowing the column name.&lt;/P&gt;&lt;P&gt;My suggestion to create a collection with dynamic columns is this but without knowing the fields of the collection we can't assign the values,&lt;/P&gt;&lt;P&gt;1. Get fields of the collection after Json to collection&lt;/P&gt;&lt;P&gt;2. Loop the fields and use append field&amp;nbsp;(Text) to collection action to add a field into a Final collection&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nandhakumar_0-1751364711430.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/41141iA6061A8E92848CDC/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Nandhakumar_0-1751364711430.png" alt="Nandhakumar_0-1751364711430.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this way we can create the collection with fields which are coming via json. but without having the list of fields possible in a json response not possible to assign.&lt;/P&gt;&lt;P&gt;let me know your thoughts!&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 10:12:22 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121289#M53385</guid>
      <dc:creator>Nandhakumar</dc:creator>
      <dc:date>2025-07-01T10:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121299#M53387</link>
      <description>&lt;P&gt;I wrote Python code to change all items of JSON to text format.&lt;BR /&gt;However, even with the JSON converted using this code, the data type of the items is automatically determined when using Utility - JSON &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import json
input_file = 'input.json'
output_file = 'output.json'

import os
import sys
os.chdir(os.path.dirname(os.path.abspath(sys.argv[0])))

def convert_values_to_str(data):
    if isinstance(data, dict):
        return {str(k): convert_values_to_str(v) for k, v in data.items()}
    elif isinstance(data, list):
        return [convert_values_to_str(item) for item in data]
    else:
        return str(data)

try:
    with open(input_file, 'r', encoding='utf-8') as f:
        original_data = json.load(f)

    text_data = convert_values_to_str(original_data)

    with open(output_file, 'w', encoding='utf-8') as f:
        f.write(json.dumps(text_data, ensure_ascii=False, indent=4))

    print(f"Finished: {output_file}")

except Exception as e:
    print(f"Error: {e}")

input("Finished. Press Enter")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Jul 2025 03:01:58 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121299#M53387</guid>
      <dc:creator>sumire</dc:creator>
      <dc:date>2025-07-02T03:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121301#M53389</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/296"&gt;@sumire&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;i would suggest you to write the code for converting the columns datatype into text of a collection.&lt;/P&gt;&lt;P&gt;Yes, JSON to collection utility automatically detects the data type. So first convert json to collection then write a code to change all the columns data type.&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 08:43:12 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121301#M53389</guid>
      <dc:creator>Nandhakumar</dc:creator>
      <dc:date>2025-07-02T08:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121304#M53390</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/296"&gt;@sumire&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try this code for converting all the fields into text data type. vb code just add it in collection manipulation utility as new page.&lt;/P&gt;&lt;P&gt;' Create a new DataTable to hold the output&lt;BR /&gt;Dim outputTable As New DataTable()&lt;/P&gt;&lt;P&gt;' Add columns as Text&lt;BR /&gt;For Each column As DataColumn In InputCollection.Columns&lt;BR /&gt;outputTable.Columns.Add(column.ColumnName, GetType(String))&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;' Loop through each row and convert values to text&lt;BR /&gt;For Each row As DataRow In InputCollection.Rows&lt;BR /&gt;Dim newRow As DataRow = outputTable.NewRow()&lt;BR /&gt;For Each column As DataColumn In InputCollection.Columns&lt;BR /&gt;If row.IsNull(column) Then&lt;BR /&gt;newRow(column.ColumnName) = ""&lt;BR /&gt;Else&lt;BR /&gt;newRow(column.ColumnName) = row(column.ColumnName).ToString()&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;BR /&gt;outputTable.Rows.Add(newRow)&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;' Set the output&lt;BR /&gt;OutputCollection = outputTable&lt;/P&gt;&lt;P&gt;before this you can convert the json to collection.&lt;/P&gt;&lt;P&gt;Note: I have tested the code and it is working fine. but make sure to the values you are converting whether they stay the same or values change.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nandhakumar_0-1751459852353.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/41143iCCC59CD9EABB40F8/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Nandhakumar_0-1751459852353.png" alt="Nandhakumar_0-1751459852353.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 12:37:45 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121304#M53390</guid>
      <dc:creator>Nandhakumar</dc:creator>
      <dc:date>2025-07-02T12:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121327#M53393</link>
      <description>&lt;P&gt;I decided to modify "Utility - JSON" VBO.&lt;/P&gt;&lt;P&gt;I altered the global code of the VBO.&lt;BR /&gt;By modifying it this way, JSON records are stored in the collection as plain text instead of as an array of [JSON:Array].&lt;/P&gt;&lt;P&gt;Here is the code for the modified parts:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Private Function DeserialiseArrayWithoutJArray(ByVal jarr As JArray, ByVal populate As Boolean) As DataTable
    Dim dt As New DataTable

    ' Column definition (fixed as string type for all)
    If jarr.Count &amp;gt; 0 AndAlso TypeOf jarr(0) Is JObject Then
        Dim firstObj As JObject = DirectCast(jarr(0), JObject)
        For Each prop As JProperty In firstObj.Properties()
            If Not dt.Columns.Contains(prop.Name) Then
                dt.Columns.Add(prop.Name, GetType(String)) ' Force the data type to be fixed as String
            End If
        Next
    End If

    ' Loading line data
    If populate Then
        For Each token As JToken In jarr
            If TypeOf token Is JObject Then
                Dim row As DataRow = dt.NewRow()
                For Each prop As JProperty In DirectCast(token, JObject).Properties()
                    row(prop.Name) = prop.Value.ToString()
                Next
                dt.Rows.Add(row)
            End If
        Next
    End If

    Return dt
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2025 00:56:27 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121327#M53393</guid>
      <dc:creator>sumire</dc:creator>
      <dc:date>2025-07-04T00:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121328#M53394</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/399"&gt;@Nandhakumar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The solution to add actions to the 'Collection Manipulation' VBO is also great. I will try it myself.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2025 01:05:19 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121328#M53394</guid>
      <dc:creator>sumire</dc:creator>
      <dc:date>2025-07-04T01:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to collection: store all items as text format</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121329#M53395</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/296"&gt;@sumire&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Great to hear that you are able to resolve the issue &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2025 01:29:30 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-collection-store-all-items-as-text-format/m-p/121329#M53395</guid>
      <dc:creator>Nandhakumar</dc:creator>
      <dc:date>2025-07-04T01:29:30Z</dc:date>
    </item>
  </channel>
</rss>

