Hello All,

i have an entity named "employees" and an entity named "details" in which i save their data(their info- age, gender, mobile phone). The age is mandatory. Every employee detail, is created new record in the "details" entity under the unique employee id. So, an employee may have from one(the age which is mandatory) to max 3 details in total.

The other details (gender and mobile) are optional. I want to preview the employees who has fill, except the age which is mandatory, the other two optional details.

Any advise?

Hi George,

I am not sure what do you mean by preview. But if you mean that you want to display gender and mobile only if they have value in it then it is simple. Just enclose them in a container (including its lable if you have on your screen) and on container's Visible/ display property (visible for mobile and reactive and display for traditional web app) apply condition like below

SyntaxEditor Code Snippet

GetEmployeeById.List.Current.Employee.Phone  <> ""

If you want to filter employees in aggrigate if they don't have these attribute valued then you can apply similer condition in aggrigate filters.

Thanks for your reply. Using preview i mean display as correctly you said.

If i aggregate with your suggestion, then will be displayed any other record for the employee which is field.

For example, as employee i fill my age and my mobile only (not the gender. So two records will be created in the entity. One for the age and another one with the mobile. Both will be correlated in my employee id which is unique. So, this employee will not be displayed because i have not fill at least one optional value.(in my example the gender).

On the other hand, if i had fill the gender, the employee  should be displayed.

Hi George,

Adding to what Nikhil suggested, the other option is, you can wrapper the optional section in an IF widget with a specified Boolean condition i.e.

Conditional Expression for Gender Info Container

GetEmployeeById.List.Current.Employee.GenderId <> NullIdentifier()

Conditional Expression for Phone Info Container

GetEmployeeById.List.Current.Employee.Phone  <> ""


Difference between using the IF widget and setting the display property is

- IF widget get executed in the server side i.e. if the IF widget conditional expression returns False value then the element will not be available in the DOM

- By setting the Display property to False boolean value - in actual the container/UI element is added with 

style = display: none;

It means, the optional section is available in the DOM, of which the style property can be manipulated at the client-end i.e. Using the Browser inspect element feature


Conclusion - Use any of the above mentioned options as per your requirement by considering their difference.

Hope this helps you!


Regards,

Benjith Sam

Thanks for your reply. The request is dont preview the employee record, not to dont display some of him/her values from optional values.

George Mitsiou wrote:

Thanks for your reply. Using preview i mean display as correctly you said.

If i aggregate with your suggestion, then will be displayed any other record for the employee which is field.

For example, as employee i fill my age and my mobile only (not the gender. So two records will be created in the entity. One for the age and another one with the mobile. Both will be correlated in my employee id which is unique. So, this employee will not be displayed because i have not fill at least one optional value.(in my example the gender).

On the other hand, if i had fill the gender, the employee  should be displayed.

Hi George,

I gave you two suggestion and I am not sure which one you were looking for. 

1. In first one I shared how to hide specific field when displaying any employee record.

2. In second you can filter employees data based on any attribute if it has value or not.

Which one do you need.

Also as you said for age and mobile separate records will be added for gender and age but ideally there should be two attribute values in same record unless you have dynamic forms. So will be good if you can share a sample oml which I can check and suggest you better.