1417
Views
10
Comments
Generic List Input Parameter
Question
Hi,

I would like to create an action that receives as input parameter a list of generic objects or a record list with no record associated.

Is this possible?
As anyone done something like this?

tks.
UserImage.jpg
Luciano Guimaraes

Hi folks, any thoughts about this !?

2019-11-12 17-31-26
Justin James
 
MVP

No way to do it at this time.

J.Ja

2026-02-22 12-17-28
kean amper

Justin James wrote:

No way to do it at this time.

J.Ja

Hi Justin, 

     If you look on JSON Serialize there is an input parameter called "data" which accept any record. So im confused what you said there is no way but there is available out there.  That's the functionality by the way i want


2019-11-12 17-31-26
Justin James
 
MVP

kean amper wrote:

Justin James wrote:

No way to do it at this time.

J.Ja

Hi Justin, 

     If you look on JSON Serialize there is an input parameter called "data" which accept any record. So im confused what you said there is no way but there is available out there.  That's the functionality by the way i want



Yes, but that is not "pure OutSystems code" (code created 100% inside of Service Studio), that is an Extension, as Remco discusses it could be done.

You cannot use a generic record or record list in "pure OutSystems code" and do anything with it. "Pure OutSystems code" is 100% strongly and statically typed.

J.Ja

2023-12-07 07-51-40
Remco Dekkinga
 
MVP

You can create an action that receives an xml or json structure and then parse the contents of the structure. 

Or you create an extension with the integration studio that has an object as input and parse the contents in java or c#.

2019-11-12 17-31-26
Justin James
 
MVP

Remco Dekkinga wrote:

You can create an action that receives an xml or json structure and then parse the contents of the structure. 

Or you create an extension with the integration studio that has an object as input and parse the contents in java or c#.


Yes, but at *some* point, if you want this to be useful to the application, you will be stuck. OK, so the extension parsed the XML/JSON. Now what does it return? Unless you are going to return an Object that is a pointer to a node, and let the programmer walk the nodes (not easy to work with), it doesn't really get you anywhere. At some point, you will run into the fact that OutSystems just does not support non-typed or dynamically typed structures. It's one of the tradeoffs of the system. It is much simpler to learn and you can't write confusing code... but when you NEED something liek that, it isn't there.


J.Ja

UserImage.jpg
Luciano Guimaraes

Thank you all for the comments.

I could get it done by passing the list attribute "Empty" as an input parameter for a mobile app block. I notice this is done like the parameter was passed by reference because the UI is updated when the attribute value changes, so it works well for me. Another parameter was the "HasFetchError" aggregate attribute that works fine too.

I agree abstract data types could be a mess and it gets the software maintenance too hard.

Till now, I can live without this :-)

2026-02-22 12-17-28
kean amper

Hi may i know thought of this? im having same issue, i want a generic datatype record im working on web not mobile

UserImage.jpg
Anthony Phan

I also have a requirement for this. Is there any update on this topic? 

2023-01-05 17-39-49
Leonardo Pires
Champion

Hi Anthony.

As far as I know it hasn't been implemented yet, but there is a "hack" to create this generic record list.

Some actions of the module (systems), use this List of generic records (for example ListRemove), you just have to copy this parameter and reuse it in your actions.

If you are going to use this generic input parameter in a server action, you will know that it can cause the following error

Internal Error "Invalid compiler output. Object reference not set to an instance of an object."

Cheers

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.