set cascading lookup filter based on the value of a choice field

  • 19 June 2019
  • 4 replies
  • 118 views

I'm attempting to set the value of the below cascading lookup field based on a choice field in the below form to request approval to travel.

 

I have set-up the below section of the form using cascading lookups to filter the list of cities when a country is selected for both Departure and Destination. 

 

2645i353C8772C1DB70AC.png

 

My issues started when I attempted to

a) Prevent the selection of identical countries when Flight Type = International 

 

2643i921984C9787C9158.png

 

 

b) Set and disable the Destination country when Flight Type = Domestic. I am unable to filter the Destination country using rules or by calculated values, and I created a new field for the domestic city which is conditionally hidden based on Flight Type however when hiding fields on this form, field layout went a little haywire.

 

2646i2C78B901E0E7BA6F.png

 

c) I also need to prevent the date of departure being set to prior to the current date, also when add new row is selected It would be useful to set the date to the previous date of departure + 1

 

however I believe this is achievable using custom javascript although  I am familiar with JavaScript I wouldn't class myself as able to write anything even close to accomplishing this requirement.

 

This is a complex form with many sections which I really need assistance with.

Thanks

Chet

 


4 replies

Badge +17

Custom javascript would probably help with this. Also we are releasing a new responsive forms which has some nice form rules that may make this easier. You can connect with @EuanGamble for more info on the new responsive forms.


 


Regarding your immediate issues, I would possibly pivot the data for input slightly differently.


I would set up the selection by highest tier first, which may be flight type. This would mean setting up a panel with repeating sections that include the correct options.


 


A. It seems that domestic/international drives everything else so I would have the user select that first. If international, then you have the cascading for country setup as it should be where country cannot equal the same or whatever you have there. If they choose Domestic, a completely different panel with repeating sections show with the correct options showing. It's not that your rules aren't working but it could be that something is conflicting and just unknown.


 


B. For this, use a rule to disable destination city if flight type is domestic. Then use a workflow to set the destination city = departure city if it is domestic. I would almost recommend flipping this to Responsive forms as you have the ability to use a new rule type which is "set field value" which could help make that easy.


 


C. This is a bit tricky to achieve because it would require javascript to do that. If you aren't familiar with javascript then I would recommend avoiding it. Again, the new responsive form designer that is available in O365 does have formula builder that you can use to create date validation.


 


Hope that helps.

Badge +3

Hi @ChetChudasamaTS 


 


Regarding C: prevent the date of departure being set to prior to the current date


Please review Thomas's suggestion in the link below, this will also work for Forms for O365


https://community.nintex.com/t5/Nintex-for-SharePoint/Hi-in-Nintex-Form-how-can-i-stop-user-to-select-a-past-date-in-a/td-p/45163

Hey thanks for the response,


I added a couple more posts that depend on these selections so appreciate your help, I tried using the responsive layout but the limit of 4 columns prevented me from adding the Expense Claim table


 


Unless we can now achieve this using the responsive layout

Hi Tanbir,

This works but only when the user hits save, ideally we need this to be highlighted as invalid on select instead

Thanks
Chet

Reply