Error passing Sting input into Python script

I am trying to pass a string variable I got from Input Dialog into a Python function as an argument. But when I tried to put the variable into Input Parameters, I get the error below:

String’ cannot be converted to ‘System.Collections.Generic.IEnumerable(Of Object)’ because ‘Char’ is not derived from ‘Object’, as required for the ‘Out’ generic parameter ‘T’ in ‘Interface IEnumerable(Of Out T)’.

Can anyone help please?

Hi @Toby_T

Pass the input arguments like this

{Your_input_variable}

Thanks
Robin

Hi Robin, thanks, it worked. Now, I changed my function to take in both a string variable jsonInput and a double variable as an argument but I got this error in the logs:

00:24:27.9852 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [39] Python Scope: Error initializing Python engine
00:25:11.7070 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [58] Python Scope: Pipe is broken.
00:27:56.2937 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [69] Python Scope: Pipe is broken.
00:29:50.8169 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [104] Python Scope: Pipe is broken.
00:30:37.9635 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [76] Python Scope: Pipe is broken.
00:49:12.9663 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [1] Sequence.xaml: Compiler error(s) encountered processing expression “jsonInput”.
’String’ cannot be converted to ‘System.Collections.Generic.IEnumerable(Of Object)’ because ‘Char’ is not derived from ‘Object’, as required for the ‘Out’ generic parameter ‘T’ in ‘Interface IEnumerable(Of Out T)’.
00:50:42.7873 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [85] Invoke Python Method: One or more errors occurred.
12:54:03.2135 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [68] Invoke Python Method: One or more errors occurred.
17:06:14.0178 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [92] Invoke Python Method: One or more errors occurred.
17:11:12.3956 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [19] Get Python Object: Error converting Python object
17:12:53.3214 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [43] Get Python Object: Error converting Python object
17:14:33.1149 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [57] Get Python Object: Error converting Python object
17:36:18.5241 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [124] Get Python Object: Error converting Python object
17:43:09.2505 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [107] Invoke Python Method: One or more errors occurred.
17:44:10.6035 => [ERROR] [UiPath.Studio.App.Logging.OutputLogger] [39] Invoke Python Method: One or more errors occurred.
**17:44:47.9581 => [ERROR] [UiPath.Studio] [1] RemoteException wrapping System.Exception: Cannot evaluate 'object[2] **
Identifier expected.

Could you advise please?

Hi @Toby_T
Can you share your input argument as screen shot
&
expected output as screen shot

Hi, please find below:

This are my arguments:

I can’t share my expected output but it is a dictionary.

I also added this below in my code, if it helps:

image