<?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 static collection in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88301#M38876</link>
    <description>&lt;P&gt;&lt;SPAN&gt;how to&amp;nbsp; &lt;/SPAN&gt;Use Code stage to copy data to static collection. Pass Input as Collection schema, if not passed then code will create own collection else write data to input collection.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Anusha GP&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Wed, 24 Aug 2022 11:10:00 GMT</pubDate>
    <dc:creator>AnushaGP</dc:creator>
    <dc:date>2022-08-24T11:10:00Z</dc:date>
    <item>
      <title>static collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88301#M38876</link>
      <description>&lt;P&gt;&lt;SPAN&gt;how to&amp;nbsp; &lt;/SPAN&gt;Use Code stage to copy data to static collection. Pass Input as Collection schema, if not passed then code will create own collection else write data to input collection.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Anusha GP&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Aug 2022 11:10:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88301#M38876</guid>
      <dc:creator>AnushaGP</dc:creator>
      <dc:date>2022-08-24T11:10:00Z</dc:date>
    </item>
    <item>
      <title>RE: static collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88302#M38877</link>
      <description>Hello &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/51384"&gt;@AnushaGP&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;I'm not sure I understand your question, but one important thing to understand here is that a Blue Prism Collection is just a .NET DataTable behind the scenes. So anything you can do with a DataTable, you can do with a Collection in a Code stage.&lt;BR /&gt;&lt;BR /&gt;Back to your question, are you talking about passing a Collection into a Code stage that has defined columns but may not have any rows?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Aug 2022 20:45:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88302#M38877</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2022-08-24T20:45:00Z</dc:date>
    </item>
    <item>
      <title>RE: static collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88303#M38878</link>
      <description>I need a code to copy data into static collection&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Anusha GP&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Aug 2022 08:26:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88303#M38878</guid>
      <dc:creator>AnushaGP</dc:creator>
      <dc:date>2022-08-26T08:26:00Z</dc:date>
    </item>
    <item>
      <title>RE: static collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88304#M38879</link>
      <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/51384"&gt;@AnushaGP&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Ok. As I said previously, a Blue Prism Collection is nothing more than a .NET DataTable within a Code stage. There are lots of examples online for dealing with DataTables. In fact, you could take the &lt;STRONG&gt;Utility - Collections Manipulation&lt;/STRONG&gt; VBO and review the Code stages it contains as they all implement different bits of code for dealing with a Collection/DataTable.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If what you're looking for is the code the create a Collection from scratch in a Code stage, it looks something like this (of course the DataColumn definitions would change based on your specific use case).&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-vbnet"&gt;&lt;CODE&gt;' Create new DataTable instance.
Dim table As New DataTable

' Create 3 typed columns in the DataTable.
table.Columns.Add("FName", GetType(String))
table.Columns.Add("LName", GetType(String))
table.Columns.Add("Email", GetType(String))

' Add a few rows with those columns filled in the DataTable.
table.Rows.Add("John", "Doe", "jdoe@email.com")
table.Rows.Add("Robert", "Johnson", "rj@blahblah.com")
table.Rows.Add("Philip", "Masters", "pmasters@junkmail.com")

' Set our Output data item (i.e. Collection) to the value of the new DataTable
myCollection = table
&lt;/CODE&gt;&lt;/PRE&gt;
​&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Aug 2022 11:52:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88304#M38879</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2022-08-26T11:52:00Z</dc:date>
    </item>
    <item>
      <title>RE: static collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88305#M38880</link>
      <description>&lt;P&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/833"&gt;@ewilson&lt;/a&gt; &amp;nbsp;Do you know what the datatable implementation looks like in the background when you have a collection within a collection? A column in a datatable can only be value types, if im not mistaken?&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ivar Buvarp Toft&lt;BR /&gt;RPA Develop&lt;BR /&gt;Europe/Oslo&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 22 May 2023 12:04:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88305#M38880</guid>
      <dc:creator>Ivar_BuvarpToft</dc:creator>
      <dc:date>2023-05-22T12:04:00Z</dc:date>
    </item>
    <item>
      <title>RE: static collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88306#M38881</link>
      <description>&lt;P&gt;&lt;A class="user-content-mention" data-sign="@" data-contactkey="b181d461-e248-4c4e-8aee-68a987f0edaa" data-tag-text="@Ivar Buvarp Toft" href="https://community.blueprism.com/network/profile?UserKey=b181d461-e248-4c4e-8aee-68a987f0edaa" data-itemmentionkey="4b59597e-90e6-4e6a-8d3d-4030e863312e"&gt;@Ivar Buvarp Toft&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here's an example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;// Create the top-level/parent DataTable and define a DataColumn of type DataTable.
DataTable cars = new DataTable();
cars.Columns.Add("Name", typeof(string));
cars.Columns.Add("Specs", typeof(DataTable));

// Define the child DataTable
DataTable carSpecs = new DataTable();
carSpecs.Columns.Add("VIN", typeof(string));
carSpecs.Columns.Add("Model Year", typeof(int));
carSpecs.Columns.Add("Color", typeof(string));

// Populate the child DataTable
carSpecs.Rows.Add("123456789", 1990, "Red");
carSpecs.Rows.Add("987654321", 1965, "White");
carSpecs.Rows.Add("741258963", 2005, "Black");

// Insert the child DataTable into the parent. 
cars.Rows.Add("Mustang", carSpecs);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;You can take this idea pretty much as deep as you want to go. Just remember that if you want to drill into the values within a child DataTable, you have to make sure to cast the value of the cell containing the child to type DataTable.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 22 May 2023 14:57:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/static-collection/m-p/88306#M38881</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2023-05-22T14:57:00Z</dc:date>
    </item>
  </channel>
</rss>

