<?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 Invalid expression for input parameter in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Invalid-expression-for-input-parameter/m-p/98284#M46080</link>
    <description>&lt;DIV&gt;Good afternoon,&lt;/DIV&gt;
&lt;DIV&gt;I hope you're well.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I have a C# class (static class) that accepts two DataTables (collections), and returns one Datatable as output.&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;I've declared this static class in my Global Code page.&lt;/LI&gt;
&lt;LI&gt;The code is utilising&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;System&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;System.Data&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;namespaces, both of which are declared in the Code Options tab of the Initialise page.&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;The signature of the class is:&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="code-toolbar"&gt;
&lt;PRE class="language-csharp" data-code-brush="C#" rel="highlighter" tabindex="0"&gt;&lt;CODE&gt; static DataTable DoSomething(DataTable destination, DataTable source)
    {
        ...
        ...
        ...
        return destination;
    }&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="toolbar"&gt;
&lt;DIV class="toolbar-item"&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;Now I want to call this static class in my code stage.&lt;/DIV&gt;
&lt;DIV&gt;In the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;input&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the code stage, I have declared two collections:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;source&lt;/LI&gt;
&lt;LI&gt;destination&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;output&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the code stage, I have declared one collection:&lt;/DIV&gt;
&lt;DIV&gt;outputDataTable&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;and within the code tab, I've got one line which calls the 'DoSomething' static class:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="code-toolbar"&gt;
&lt;PRE class="inserted-code line-numbers language-c" data-code-brush="C#" rel="highlighter" tabindex="0"&gt;&lt;CODE&gt;outputDataTable = DoSomething(destination, source);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="toolbar"&gt;
&lt;DIV class="toolbar-item"&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;The problem is, I am getting this object level (not compiler!) error:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Invalid expression for input parameter '&lt;STRONG&gt;source&lt;/STRONG&gt;' - Data items must be between [ and ]. Text must be between " and ". Functions should be in the form FunctionName()&lt;/LI&gt;
&lt;LI&gt;Invalid expression for input parameter '&lt;STRONG&gt;destination&lt;/STRONG&gt;' - Data items must be between [ and ]. Text must be between " and ". Functions should be in the form FunctionName()&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;My question is, if you declare a static class in global code with this signature:&lt;/DIV&gt;
&lt;DIV&gt;&lt;IMG src="https://eucattachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NzExOTQ4NDQ3OCwiZG9tYWluIjoiYmx1ZXByaXNtZXUuZnJlc2hkZXNrLmNvbSIsImFjY291bnRfaWQiOjQ5MDIwNn0.u_1NfVmre0vqO9-78fsufZ4lfPHMfsrGTUd-WPb6PLs" class="fr-fic fr-fil fr-dib img-responsive" /&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;How do you call that static class within the code stage to not get the invalid expression for input parameter error?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 03 Aug 2023 10:25:32 GMT</pubDate>
    <dc:creator>KingSerok</dc:creator>
    <dc:date>2023-08-03T10:25:32Z</dc:date>
    <item>
      <title>Invalid expression for input parameter</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Invalid-expression-for-input-parameter/m-p/98284#M46080</link>
      <description>&lt;DIV&gt;Good afternoon,&lt;/DIV&gt;
&lt;DIV&gt;I hope you're well.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I have a C# class (static class) that accepts two DataTables (collections), and returns one Datatable as output.&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;I've declared this static class in my Global Code page.&lt;/LI&gt;
&lt;LI&gt;The code is utilising&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;System&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;System.Data&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;namespaces, both of which are declared in the Code Options tab of the Initialise page.&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;The signature of the class is:&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="code-toolbar"&gt;
&lt;PRE class="language-csharp" data-code-brush="C#" rel="highlighter" tabindex="0"&gt;&lt;CODE&gt; static DataTable DoSomething(DataTable destination, DataTable source)
    {
        ...
        ...
        ...
        return destination;
    }&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="toolbar"&gt;
&lt;DIV class="toolbar-item"&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;Now I want to call this static class in my code stage.&lt;/DIV&gt;
&lt;DIV&gt;In the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;input&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the code stage, I have declared two collections:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;source&lt;/LI&gt;
&lt;LI&gt;destination&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;output&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the code stage, I have declared one collection:&lt;/DIV&gt;
&lt;DIV&gt;outputDataTable&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;and within the code tab, I've got one line which calls the 'DoSomething' static class:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="code-toolbar"&gt;
&lt;PRE class="inserted-code line-numbers language-c" data-code-brush="C#" rel="highlighter" tabindex="0"&gt;&lt;CODE&gt;outputDataTable = DoSomething(destination, source);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="toolbar"&gt;
&lt;DIV class="toolbar-item"&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;The problem is, I am getting this object level (not compiler!) error:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Invalid expression for input parameter '&lt;STRONG&gt;source&lt;/STRONG&gt;' - Data items must be between [ and ]. Text must be between " and ". Functions should be in the form FunctionName()&lt;/LI&gt;
&lt;LI&gt;Invalid expression for input parameter '&lt;STRONG&gt;destination&lt;/STRONG&gt;' - Data items must be between [ and ]. Text must be between " and ". Functions should be in the form FunctionName()&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;My question is, if you declare a static class in global code with this signature:&lt;/DIV&gt;
&lt;DIV&gt;&lt;IMG src="https://eucattachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NzExOTQ4NDQ3OCwiZG9tYWluIjoiYmx1ZXByaXNtZXUuZnJlc2hkZXNrLmNvbSIsImFjY291bnRfaWQiOjQ5MDIwNn0.u_1NfVmre0vqO9-78fsufZ4lfPHMfsrGTUd-WPb6PLs" class="fr-fic fr-fil fr-dib img-responsive" /&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;How do you call that static class within the code stage to not get the invalid expression for input parameter error?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 10:25:32 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Invalid-expression-for-input-parameter/m-p/98284#M46080</guid>
      <dc:creator>KingSerok</dc:creator>
      <dc:date>2023-08-03T10:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid expression for input parameter</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Invalid-expression-for-input-parameter/m-p/98285#M46081</link>
      <description>&lt;P&gt;I am going to hazard a guess that when you are using the code stage, you have not enclosed your collections in square brackets in the parameters. That message is a Blue Prism expression message. As you can see from my example below, I have not enclosed my "handle" data item in square brackets so Blue Prism doesn't know what it is dealing with.&amp;nbsp;&lt;/P&gt;
&lt;DIV class="media" style="overflow: hidden"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35782.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/35796i0538E43AFA079619/image-size/large?v=v2&amp;amp;px=999" role="button" title="35782.png" alt="35782.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV class="media" style="overflow: hidden"&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Aug 2023 12:42:25 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Invalid-expression-for-input-parameter/m-p/98285#M46081</guid>
      <dc:creator>MichealCharron</dc:creator>
      <dc:date>2023-08-03T12:42:25Z</dc:date>
    </item>
  </channel>
</rss>

