ListClear action in Service Studio?

Dear All,

It's very easy to fill an array (Record List variable type) in Outsystems.

I'm currently trying to clear an array in a generic way.
I.e. by calling a (currently non-existing) ListClear action.

Offcourse It's possible to create another variable with the same but empty structure,
but it would be very nice to have this in a function.



Hi Eric,

You can use the attached extension to do what you want. You have to call the method in Service Studio passing the RecordList variable enclosed in a ToObject() call.

Hi André,

Thanks for your quick response.
I'm getting compile error:

NET Compilation.
 Could not locate the .NET Framework SDK.  The task is looking for the path to the .NET Framework SDK at the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework.  You may be able to solve the problem by doing one of the following:  1.) Install the .NET Framework SDK.  2.) Manually set the above registry key to the correct location.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.framework, Version=, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
RecordListUtilsTest.cs(4,7): error CS0246: The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
RecordListUtilsTest.cs(13,10): error CS0118: 'OutSystems.NssRecordListUtils.RecordListUtilsTest.SetUp()' is a 'method' but is used like a 'type'
RecordListUtilsTest.cs(27,10): error CS0246: The type or namespace name 'Test' could not be found (are you missing a using directive or an assembly reference?)
Hi Eric,

Forgot to include a dll in the extension.

See if this one's ok.

Hi André,

After I've changed the IPP on the XIF. (
I was able to publish the extension.

This works like a charm; thanks and thumbs up!

Any chance of a JAVA version being created for this or an adoption in the platform under Built-in Actions as ListClear ? :)

Hi Eric,

Glad I could help.

Attached is full version both for .NET and Java.

Thanks André!
Hi Guy's,

Is there any chance that the ListClear() function is adopted as part of the Built-in functions?

A ListInvert() and ListSort() would be nice too by the way. ;)
Hi Eric,

Well, I'm taking a chance here and say that there is indeed a good chance that the ListClear action will be part of Service Studio's built-in functions in the future.

I won't say the same for the ListInvert and ListSort, though, but you can always propose that in our Wisdom of the Crowds ;)


Paulo Tavares

I will post the idea there!
Check also the ListUtils component.

Best Regards,
Gustavo Guerra
Thanks Gustavo, that indeed provides a part of what I need.