cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Forms connect 2 fields to the same column

Hi all,

I have a divisions field in my SharePoint list which has the following values: All, div1, div2, div3. Business rule says that if you pick All you cannot pick the other values. You can pick more values, eg. div1, div2, div3 together, as long as All isn't picked.

Since you can't pick All together with other values I create a checkbox field with a Soure view which returns All as the only option. I also added a second checkbox control which is also based on a source view that excluded the All value but returns all the other option (div1, div2, div3).The type of the column in the SharePoint list is a lookup to a divisions list.

When I open up the form to update an existing list item the value of the control which is furthest of the pasge is saved. Since All checkbox is above the Divisions checkboxes only a division was stored.

Anyone with an answer or tips? Appreciate it!

0 Kudos
Reply
6 Replies
Not applicable

Re: Forms connect 2 fields to the same column

Anyone have a clue? I can't imagine nobody tried doing this before

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Forms connect 2 fields to the same column

Connect a validation rule to devision control with a rule looking like:

and(contains({Self},'All'),contains({Self},'div'))

Kind regards

Manfred

0 Kudos
Accept as Solution Reply
Not applicable

Re: Forms connect 2 fields to the same column

Manfred,

Unfortunately that doesn't work out. Underneath some more context regarding the problem.

Would it be easier to to just have all values available in one control and apply the business rule through other means (If you pick 'All' you can't pick any other items)? Problem that occurs when I split up in 2 controls as mentioned above is that only the values of the last control will be saved.

divisions.PNG

I have the same issue when I use these controls.

AutoApplic.PNG

Both automation packages and application integration packages reside in the same list. Distinction is made by a column in the source list. User needs to pick values from both controls but only the application integration packages get saved.

How to resolve this?

0 Kudos
Accept as Solution Reply
Not applicable

Re: Forms connect 2 fields to the same column

Does anyone need more info on this issue? You can do this ootb with Nintex Forms so I can't imagine no one ever ran into trouble with this!

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Forms connect 2 fields to the same column

can You prefix divisions with '>' or another character then following rule is working:

Kind regards

Manfred

Accept as Solution Reply
Not applicable

Re: Forms connect 2 fields to the same column

Worked out the issue for the divisions part.

I created a javascript function to handle this (custom validation on control calling js from the form settings). I did not find a clean way to put this in a rule though.

Manfred Lauer​ unfortunately  your '>' rule can't be used in my case but indeed it would have worked. Kudos!

Code below:

function divisionsValidate(source, arguments){     var selectedOutcome = NWF$(".divisions input:checked");     var allVals = [];     var pastedOutcome = "";     selectedOutcome.each(function() {         allVals.push(NWF$(this).val());});     var allSelected = false;     var moreSelected = false;     for (var i = 0; i < allVals.length; i++) {         if(allVals == 1){             allSelected = true;         }         if(allVals != 1){             moreSelected = true;         }     } arguments.IsValid = true;     if (allSelected && moreSelected) {//invalid         arguments.IsValid = false;     }    }

Hope this can be handy for someone else!

Best regards,

Kristof

0 Kudos
Accept as Solution Reply