hey, dears,
I am new in UIpath and I has a small problem when I try to add a new string to list as in the start course as in video by using invoke method the following message appears
TargetType and TargetObject are mutually exclusive for InvokeMethod ‘AddToList’.
what shall I do
Best Regards
@aadam
Use Add
Hi @aadam
You can add items to a list in many ways. If you are using a List variable to which you want to add items to, you can use either Add To Collection activity or the Invoke Method.
Add To Collection is pretty straight forward
However, if you wish to use the Invoke Method, for the method name, use “Add” and specify the target to your List variable.
This should work for you…
i am using invoke method and the errors appears even i use add method and specify the target method list
@aadam
Suppose if you are creating a new List let us take as List A which contains strings.
Now you have initialize first as new List(Of String)
Then use Invoke method.
Target Object as List A
Give Method name as Add
Pass the argument as string which you want to add to list.
If you want to add existing list then no need to initialize.
Regards,
Mahesh
i do that and select the list that i initialize its value
Let know how it goes for you…
thanks for your kind support
- i create a list as following
- i add invoke method as following:
3.i add the value as following:
4.and i got the following error
Best Regards
Use Capital A in Add
No change
Clear Dic variable Default value
@aadam, did it work for you? if it did, please mark the appropriate answer as the solution so it could help others as well… by the way, welcome to the community!!!
Thanks a lot for your kind support i works properly
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.