Nintex Form Tricks, Part 1: Filter List Lookup on Multiple Columns

 Computer, Sharepoint, Software  Comments Off on Nintex Form Tricks, Part 1: Filter List Lookup on Multiple Columns
Jul 152019
 
Share

I had a request to build a form where a manager could assign multiple training classes based on a job-specific need. With multiple cascading drop-down options I had to filter a list lookup.


The first task was to create a calculated column in my master SharePoint list. This combined the values from various columns to be my filter for the master training class list.

This is my calculated “Task Display” column.
=CONCATENATE(Section,”-“,[Suspense Grouping],”-“,Technology,”-“,[Sub-Technology])

In the form, I have a hidden calculated value field; “Combo”. This populates as the options are selected via the drop-down menus.
parseLookup(Section)+”-“+SuspenseRange+”-“+parseLookup(Tech)+”-“+parseLookup(sTech)

This filters the master training class list via the List Lookup control.

 Posted by at 2:24 pm  Tagged with:

Filtering and Limiting Date Pickers on Nintex Forms

 Computer, Sharepoint, Software  Comments Off on Filtering and Limiting Date Pickers on Nintex Forms
Mar 252019
 
Share

Had a project to create a service scheduling list. Certain services are only available during specific hours and specific days. The trick was to filter the date picker in relation to the service selected via Nintex javascript.

All of the code below goes into the Custom Javascript section of your form.

This first bit of code filters the available hours from the time part of the date picker.

NWF$("select[name$='Hours'] option").each(function(){
     if(NWF$(this).val().match(/^(([1-9]|12) AM)|(([5-9]|1[0-1]) PM)/g)) {
          NWF$(this).remove();
     }
});

The rest of the code filters the date picker days based on the service selected.

NWF.FormFiller.Events.RegisterAfterReady(function () {  
    NWF$('#' + Service).change(function(evt){
        switch(evt.target.value){
            case 'Oil Change' :
            NWF$('#' + dateCtrl).datepicker('option',{
            beforeShowDay: function(currDate){
                   if(currDate.getDay() == 1 )
                         return [true,""];
                   return [false,""];
     }
     })
                break;
 
         }
    });
    NWF$('#' + Service).change(function(evt){
        switch(evt.target.value){
            case 'Brake Repair' :
            NWF$('#' + dateCtrl).datepicker('option',{
            beforeShowDay: function(currDate){
                   if(currDate.getDay() == 5 )
                         return [true,""];
                   return [false,""];
     }
     })
                break;
 
         }
    });
 
    NWF$('#' + Service).change(function(evt){
        switch(evt.target.value){
            case 'Tire Repair' :
            NWF$('#' + dateCtrl).datepicker('option',{
            beforeShowDay: function(currDate){
                   if(currDate.getDay() == 2 || currDate.getDay() == 3 || currDate.getDay() == 4 )
                         return [true,""];
                   return [false,""];
     }
     })
                break;
 
         }
    });
});

Enforce Unique Values was also enabled on the Appointment Time to restrict duplicate appointments.

 Posted by at 10:21 pm  Tagged with: