Skip to main content
Nintex Community Menu Bar

Hide certain data from a drop-down choice field - is this possible?

  • November 4, 2019
  • 4 replies
  • 19 views

Forum|alt.badge.img+11

Hello

 

I have a choice drop-down field with a lot of options to select from.
The question is, is it possible to hide certain options based on if status = "xyz"


Example:

Duplicate
Reviewed
Accepted
Assigned

 

I like to hide Accepted and Assigned as soon as Status is not in "pending" anymore.

Maybe this is possible via the $ and css

 

Would appreciate your assistance.

4 replies

Forum|alt.badge.img+12
  • Scholar
  • November 4, 2019

@bimi82 ......how about using lookup list control?


Forum|alt.badge.img+11
  • Author
  • November 5, 2019

@kunalpatel 

 

I know that option but I cannot use it as it's too late!

I already got over 100 items with the current process and cannot change it to lookup control ... it would require manual update of all data etc,.

 

I am sure there is somebody out there who can assist using NWF$ and .css to make it happen.

An example is like this page but needs some tweaks to make it work?


Forum|alt.badge.img+11
  • Author
  • November 5, 2019

To explain this further:

 

There is a calculated value named varConcept and may contain values such as Pending, In Review, Accepted, In Work.

 

There is a dropdown menu named varConcept which holds following options: Updated, Reviewed, Already Implemented, Duplicate, Assigned and the idea behind all this is to make a script that checks the varStatus and shows relevant options in the dropdown varConcept.

 

In simple context:

 

IF varStatus contains "Pending" then show varConcept options Updated and Duplicate
IF varStatus contains "In Review" then show varConcept options Reviewed and Already Implemented
IF varStatus contains "Accepted" then show varConcept options Assigned else hide everything
ELSE hide everything

 

 


Forum|alt.badge.img+11
  • Author
  • November 5, 2019

After so many trial and errors I got it working:

 

NWF$(document).ready(function() { 
   if (NWF$('#' + varStatus).val() == 'Pending' )
    {
      NWF$("#"+ varConcept).find("option[value='Pending']").remove();
      NWF$("#"+ varConcept).find("option[value='Reviewed']").remove();      
    }
   if (NWF$('#' + varStatus).val() == 'In Review' )
    {
      NWF$("#"+ varConcept).find("option[value='Pending']").remove();
      NWF$("#"+ varConcept).find("option[value='Updated']").remove();
       }
});