<?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: How to Configure a collection to Web API request with JSON template? in University Forum</title>
    <link>https://community.blueprism.com/t5/University-Forum/How-to-Configure-a-collection-to-Web-API-request-with-JSON/m-p/77639#M421</link>
    <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/44911"&gt;@Mani&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;When you say you want to map the Collection what are you trying to do? Figure out if you can serialize a Collection straight to JSON? If so, are you using the &lt;STRONG&gt;Utility - JSON&lt;/STRONG&gt; VBO?&lt;BR /&gt;&lt;BR /&gt;The action &lt;EM&gt;&lt;STRONG&gt;Collection to JSON&lt;/STRONG&gt;&lt;/EM&gt; of the Utility - JSON VBO will take an input Collection and convert it to JSON. However, it treats a Collection as a JSON array of objects. In other words, every row in the Collection is looked at as a JSON object. Here's an example.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Example:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;What we have below is a top-level Collection with a single field titled &lt;STRONG&gt;SourceFiles&amp;nbsp;&lt;/STRONG&gt;with a field type of Collection. That Collection then has it's own definition which is two fields named &lt;STRONG&gt;Field1&lt;/STRONG&gt; and &lt;STRONG&gt;Field2&lt;/STRONG&gt; each with type Text.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Collection Definition&lt;/STRONG&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31949.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/32070iEE893546CB4F15EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="31949.png" alt="31949.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31950.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/32072iDF4C8BC5AE2A679A/image-size/large?v=v2&amp;amp;px=999" role="button" title="31950.png" alt="31950.png" /&gt;&lt;/span&gt;&lt;BR /&gt;When we run this Collection through the &lt;EM&gt;&lt;STRONG&gt;Collection to JSON&lt;/STRONG&gt;&lt;/EM&gt; action, we receive the following JSON as output.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;[
	{
		"SourceFiles": [
			{
				"Field1": "SourceFile:Row1-Field1:Row1",
				"Field2": "SourceFile:Row1-Field2 Row1"
			},
			{
				"Field1": "SourceFile:Row1-Field1:Row2",
				"Field2": "SourceFile:Row1-Field2:Row2"
			}
		]
	}
]
&lt;/CODE&gt;&lt;/PRE&gt;
&amp;nbsp;&lt;BR /&gt;Since you don't want to top-level array definition, you could always remove the top-level brackets with simple string manipulation.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&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>Fri, 04 Mar 2022 12:22:00 GMT</pubDate>
    <dc:creator>ewilson</dc:creator>
    <dc:date>2022-03-04T12:22:00Z</dc:date>
    <item>
      <title>How to Configure a collection to Web API request with JSON template?</title>
      <link>https://community.blueprism.com/t5/University-Forum/How-to-Configure-a-collection-to-Web-API-request-with-JSON/m-p/77638#M420</link>
      <description>How to map a collection to Web API request with JSON template?&lt;BR /&gt;From example I have the following JSON Template &amp;amp; I want ot map it to collection:&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;"SourceFiles": [&lt;BR /&gt;{&lt;BR /&gt;"Field1": "[Field1Value]",&lt;BR /&gt;"Field2": "[Field2Value]",&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have a collection which have values of "Field1" and "Field2".&lt;BR /&gt;How I can map the collection values to the above template?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Mani K&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Mar 2022 08:00:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/How-to-Configure-a-collection-to-Web-API-request-with-JSON/m-p/77638#M420</guid>
      <dc:creator>Mani</dc:creator>
      <dc:date>2022-03-04T08:00:00Z</dc:date>
    </item>
    <item>
      <title>RE: How to Configure a collection to Web API request with JSON template?</title>
      <link>https://community.blueprism.com/t5/University-Forum/How-to-Configure-a-collection-to-Web-API-request-with-JSON/m-p/77639#M421</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/44911"&gt;@Mani&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;When you say you want to map the Collection what are you trying to do? Figure out if you can serialize a Collection straight to JSON? If so, are you using the &lt;STRONG&gt;Utility - JSON&lt;/STRONG&gt; VBO?&lt;BR /&gt;&lt;BR /&gt;The action &lt;EM&gt;&lt;STRONG&gt;Collection to JSON&lt;/STRONG&gt;&lt;/EM&gt; of the Utility - JSON VBO will take an input Collection and convert it to JSON. However, it treats a Collection as a JSON array of objects. In other words, every row in the Collection is looked at as a JSON object. Here's an example.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Example:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;What we have below is a top-level Collection with a single field titled &lt;STRONG&gt;SourceFiles&amp;nbsp;&lt;/STRONG&gt;with a field type of Collection. That Collection then has it's own definition which is two fields named &lt;STRONG&gt;Field1&lt;/STRONG&gt; and &lt;STRONG&gt;Field2&lt;/STRONG&gt; each with type Text.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Collection Definition&lt;/STRONG&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31949.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/32070iEE893546CB4F15EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="31949.png" alt="31949.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="31950.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/32072iDF4C8BC5AE2A679A/image-size/large?v=v2&amp;amp;px=999" role="button" title="31950.png" alt="31950.png" /&gt;&lt;/span&gt;&lt;BR /&gt;When we run this Collection through the &lt;EM&gt;&lt;STRONG&gt;Collection to JSON&lt;/STRONG&gt;&lt;/EM&gt; action, we receive the following JSON as output.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;[
	{
		"SourceFiles": [
			{
				"Field1": "SourceFile:Row1-Field1:Row1",
				"Field2": "SourceFile:Row1-Field2 Row1"
			},
			{
				"Field1": "SourceFile:Row1-Field1:Row2",
				"Field2": "SourceFile:Row1-Field2:Row2"
			}
		]
	}
]
&lt;/CODE&gt;&lt;/PRE&gt;
&amp;nbsp;&lt;BR /&gt;Since you don't want to top-level array definition, you could always remove the top-level brackets with simple string manipulation.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&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>Fri, 04 Mar 2022 12:22:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/How-to-Configure-a-collection-to-Web-API-request-with-JSON/m-p/77639#M421</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2022-03-04T12:22:00Z</dc:date>
    </item>
    <item>
      <title>RE: How to Configure a collection to Web API request with JSON template?</title>
      <link>https://community.blueprism.com/t5/University-Forum/How-to-Configure-a-collection-to-Web-API-request-with-JSON/m-p/77640#M422</link>
      <description>Thanks a lot &lt;A id="MainCopy_ctl11_ucMessageList_rptMessageList_ProfileImageDisplay_1_NameLink_1" biobubblekey="24818008-8ffc-426e-9db1-0a574118cc2b" href="https://community.blueprism.com/network/profile?UserKey=24818008-8ffc-426e-9db1-0a574118cc2b" target="_blank" rel="noopener"&gt;Eric Wilson&lt;/A&gt;,&lt;BR /&gt;I'll try in my process as you guided. This is really helpful, I was expecting this only.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Mani K&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Mar 2022 12:35:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/How-to-Configure-a-collection-to-Web-API-request-with-JSON/m-p/77640#M422</guid>
      <dc:creator>Mani</dc:creator>
      <dc:date>2022-03-04T12:35:00Z</dc:date>
    </item>
  </channel>
</rss>

