Only showing Dynamic columns attributes in form

Hello Everyone,

I'm in a problem, my use case is :

I have an entity which contains 10 attributes and inside a form, I'm showing all 10 attributes with its respective data. But the use case is that I have to only show those attributes in the front-end form whose attribute's data is not null. ie..those attributes whose data is not present (null data), I do not need to show those attributes in the form element.

Eg: Out of 10 attributes there are only 7 attributes whose values are not null, the remaining 3 attributes data is null. So I need to show only those 7 attribute columns in the front-end form.

 How can I achive this ?

Hi Beeta Sahoo,
If this form below you are using, just in the container of the attribute line, in its display, you put a conditional: attribute <> null.

I appreciate your answer Bernardo, But this is not working as per my requirement.

Thank you 

Hello Beeta,

1. Do you want to exclusively SHOW the data or the user must be able to EDIT it? In this case, it is still valid that it will be able to edit ONLY the "valid" data?

2. Where are coming the data you want to show? Is an OutSystems Entity? Is an External Entity (imported with Integration Studio)? Is the result of a Web Service method call (Rest or SOAP)?

OutSystems does not have the NULL concept. IF your data is external and holds NULL, this data will receive a default value when you retrieve it inside OutSystems (so, an integer will assume zero, a text will assume an empty string, a boolean will assume False, etc).

As you can see, if those values are "valid" values, you will have to resort to some workarounds in order to identify if the data is valid or "null".

But the workaround will depend on where are the data coming from...


Beeta Sahoo wrote:

I appreciate your answer Bernardo, But this is not working as per my requirement.

Thank you 

IMO, approach suggested by Bernardo should work. As Eduardo mentioned, the data type of the attribute will dictate out of NullIdentifier()/NullTextIdentifier()/NullDate() can be used. 

Can you share with us what have you tried so far? 

Hi everyone,

Eduardo already said everything, but let me reinforce what he mentions: OutSystems does not have the special value NULL you expect from relational databases or other languages with references and/or pointers.

This means it resorts to default values to represent empty value/lack of a meaningful value. For basic data types like numbers, text or boolean the default value will be, respectively: 0, the empty string "" or False. For Dates and identifiers (and other special data types) the platform defines a NullDate() function (that returns #1900-01-01#), NullIdentifier() (that returns 0), NullTextIdentifier() (that returns "") and also NullBinary() and NullObject() (you can check here those functions' behaviour).

Given this approach, if those default values are also possible values for your entity's attributes, there is no direct way of determining whether the value is empty or simply happens to hold the default value. You may need to define an extra boolean variable to determine if an attribute is empty or simply has the default value.