How to modify the visibility of a field ?

0
Hi Team,        In my application I’m having a page where in a listview user can check the products and provide a valuable feedback. Also later on I can those feedbacks and based on that we can proceed further. It’s not necessary to give feedback on each products by the users. Currently, I’m using a textarea for feedback field.         Now, for improvement I want to view only those feedbacks which are added by the users. For example, I’m having 3 Products A, B & C. And for each there is a feedback field where user can put their feedbacks. If an user provide a feedback for Product A and Product C then when I’m checking the application, the feedback area of these 2 products remains open while the feedback area of Product B remain closed.        To improve the functionality, in my domain model I created a boolean field named as IsFeedbackActive and sets the value as false by default. In the save button of the page I’m using a microflow to save the data and there I sets the IsFeedbackActive as true. And in the page I’m using these field for visible the feedback section if it’s true.            But the current problem is after modifying the visibility of these feedback field, for the first time when user open the page the feedback section is not showing. As the default value is false it’s not showing any feedback sections of each product.   Can anyone please suggest me how can I improve the visibility?   Regards, Tanmay Ghosh.  
asked
1 answers
2

Hi Tanmay,

 

Below are the requirements of your scenario:

 

  1. Feedback field should be visible on first page load before clicking save
  2. Feedback field should be editable if user gives feedback
  3. Feedback field should be closed if user did not give feedback.

Add 2 feedback text area fields along with 2 different visibility conditions

Along with your boolean variable keep one more visibility condition based on feedback attribute value.

 

Consider your feedback text area widget is mapped with Feedback Attribute:

 

Add the below condition expressions for visibility condition


 

First Req:  

              $currentObject/Feedback=empty and not(IsFeedbackActive)

 In this case, feedback will be empty and your isFeedbackActive value will be false which means our condition will result like true and not(false) → true and true results true

 

So the field will be visible and editable

 

Second Req:  

 

         $currentObject/Feedback!=empty and IsFeedbackActive

In this case, feedback will not be empty and your isFeedbackActive value will be true which means our condition will result like true and true → true and true results true

 

So the field will be visible and editable

 

Third Req:

    $currentObject/Feedback=empty and not(IsFeedbackActive)

 In this case, feedback will be empty and your isFeedbackActive value will be true which means our condition will result like true and not(true) → true and false results false

 

 

So the field will be closed

 

 

First Requirement and Third Requirement will have same condition whereas 2nd will be having different one

answered