How to initialize a activity property with a value of type List<String>

Hello
I am using a user’s defined activity that has a property defined as
[DisplayName(“AOXaaS Execute”)]
public class DoExecute : CodeActivity
{
[Category(“Input”)]
public List outputs { get; set; }

and when I am setting the property ‘outputs’ in UiStudio with

outputs | New List(of string)(new string(){“value1”,“value2”})

I got an exception as below
09:12:07.9110 => [ERROR] [UiPath.Studio.exe] [1] Erreur: System.NullReferenceException: La référence d’objet n’est pas définie à une instance d’un objet.
à System.Activities.Presentation.ErrorReporting.ErrorDialog.OnDialogWindowLoaded(Object s, RoutedEventArgs e)
à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
à System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
à System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
à System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
à MS.Internal.LoadedOrUnloadedOperation.DoWork()
à System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
à System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
à System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
à System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
à System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
à System.Windows.Interop.HwndTarget.OnResize()
à System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
à System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2147467261

So, what I am doing wrong?

AOXaaS.xaml (6.0 KB)

@fandre
New List(of string)(new string(){“value1”,“value2”})

statement is looking for initializing a list of strings
it receives from initialitization an array of strings

here it breaks

Ok, that’s correct. But now the ‘outputs’ property is set with

new List<String>() { "firstname",  "name", "sex"}

image

So what’s the problem?

@fandre
init a list of string can be done as below:

Just have a look on the different syntax

Get the same popup error with List(3) { “firstname”, “name”, “sex”} as ‘outputs’ value.

image

for c# try new List { “firstname”, “name”, “sex”};
kindly note lists are not arrays, so do not ry to mix up syntax and assigning any lengths to it.
Refering to your screenshot / datatype a String List is declared

That does not work neither…

@fandre
crosschecking in .Net Fiddler shows sucess
grafik

Yes, I also checked your proposal on my side and it was ok. Here the xaml file of the AOXaaS SequenceAOXaaS.xaml (5.7 KB)
May be you could find the problem in looking in?

You can find the Metrixware activities there: https://apiint.nugettest.org/v3/index.json

Thanks anyway to take time in answering to my questions.

@fandre

Yes, I also checked your proposal on my side and it was ok

so it was working?

XAML looks different from screenshot, current issue at your end is unclear. Just validate the XAML and check Validation result.

How can I validate the xaml?? (I am a beginner with UiPath)

On AOXaaS.xaml, the validator did not found any error, only 3 warnings and 1 information