cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid expression for input parameter

SRashidi
Level 3
Good afternoon,
I hope you're well.
I have a C# class (static class) that accepts two DataTables (collections), and returns one Datatable as output.
  • I've declared this static class in my Global Code page.
  • The code is utilising System and System.Data namespaces, both of which are declared in the Code Options tab of the Initialise page.
The signature of the class is:
 static DataTable DoSomething(DataTable destination, DataTable source)
    {
        ...
        ...
        ...
        return destination;
    }
Now I want to call this static class in my code stage.
In the input of the code stage, I have declared two collections:
  • source
  • destination
in the output of the code stage, I have declared one collection:
outputDataTable
and within the code tab, I've got one line which calls the 'DoSomething' static class:
outputDataTable = DoSomething(destination, source);
The problem is, I am getting this object level (not compiler!) error:
  • Invalid expression for input parameter 'source' - Data items must be between [ and ]. Text must be between " and ". Functions should be in the form FunctionName()
  • Invalid expression for input parameter 'destination' - Data items must be between [ and ]. Text must be between " and ". Functions should be in the form FunctionName()
My question is, if you declare a static class in global code with this signature:
How do you call that static class within the code stage to not get the invalid expression for input parameter error?
Thanks,
1 REPLY 1

MichealCharron
Level 8

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. 

35782.png
Micheal Charron
RBC
Toronto, Ontario
Canada