Is there any way to pass a List of an undefined type as Input (of a web block for instance)? 

So I want to create a web block with some style and behavior that receives a list, but the list could have many types of data. So I wanna pass a List as Input without specifying the type of the records inside the list.

Thanks in advance,
Ricardo M.

Hi Ricardo Neto,

As per what I have seen till now, you need to have a pre-define entity/structure to work with in outsystems. The only possible solution that I see here is that you need to define a structure of certain number of columns (the maximum columns that you can expect from the input) and then write your own logic to perform you operations.


This is not possible by default. OutSystems requires types variables. 

But If your feeling up to the challenge then the following could be a soltion. Pass a JSON (type Text) into your block and then parse that JSON to display the fields you want. 

Hi Vincent Koning,

I believe that parsing the JSON back to list will also required some defined structure or entity definition.

Hi Pranav,

That is why I said it was a challenge ;)

I can imagine a solution will use an extension that is capable of reading the JSON with the use of JSON.Net and can then return the required elements in a readable pre-defined format. This can then be displayed in the Web Block. 

The big question really is, why? Why would you want such a Web Block? And can't you design it differently by having a structure as input and then fill this structure in the preparation phase for example?

Hi Ricardo,

As others have mentioned above, no, this is not possible. Also, you really shouldn't want it. Such "generic" Web Blocks are usually the symptom of bad design.

Kilian Hekhuis wrote:

Hi Ricardo,

As others have mentioned above, no, this is not possible. Also, you really shouldn't want it. Such "generic" Web Blocks are usually the symptom of bad design.

Hi Kilian,

I guess it depends on what you are trying to achieve, but I got your point.