cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
mkriznja
Nintex Newbie

Set value in choice column

Hello,

 

I have a question. Is it possible to mark multiple choices through nintex? Example: I have a list with 3 columns: 1. Internal resources BS number of days (number) 2. Internal resources IS number of days (number) 3. External resources number of days (number). When users write a number in field 1. Internal resources BS I want to mark choice Internal BS in column Approved resources. Example:

 

And if user fill multiple field, I want to mark multiple values. How this is possible?

 

Thanks!

Labels: (1)
0 Kudos
Reply
4 Replies
janeyres
Nintex Newbie

Re: Set value in choice column

Hi,

Yes you can, one way to do this is to write some javascript to go in the Custom JavaScript section of the Form settings.

If you read the list item in script, either REST or CSOM, you can then check the column values returned and default the multi-select choices using something similar to the following code:

NWF$("#"+myChoices).find(":checkbox[value='External']").attr("checked","checked");

The example assumes the multi-select choice control has it's ID stored in a javascript variable named 'myChoices' (configured on the control's Advanced Settings tab).

Jan

0 Kudos
Reply
jr204
Nintex Newbie

Re: Set value in choice column

Hi Jan,

I am encountering issues while trying to use this.  Could you please verify if the code snippet above still works?

I've been having difficulty with what I thought would be an easy task, creating a Select All button to tick all the checkboxes for a particular control on my form.

I've followed the steps from a few different posts on here to try to achieve the desired result but while the code appears to run without error, the checkboxes never seem to be updating.

function selectAll() {

NWF$("#" + searchFields).find(":checkbox[value='Subject Line']").attr("checked","checked");

NWF$("#" + searchFields).find(":checkbox[value='Message Body']").attr("checked","checked");

NWF$("#" + searchFields).find(":checkbox[value='Attachments']").attr("checked","checked");

alert("test");

}

When I click the button, the alert is presented, but none of the checkboxes are ticked.  I have verified the javascript name of the choice control (searchFields) is set correctly.

Capture.JPG

Do you have any idea what I could be doing wrong?  I appreciate any assistance you can offer.

Thanks!

0 Kudos
Reply
janeyres
Nintex Newbie

Re: Set value in choice column

Hello,

I've tried your code and it does work for me, I've looked at it on IE10, IE11, Edge and Chrome. I've pasted some screenshots of my setup below:-

Please let me know if you're still stuck though?

Jan

0 Kudos
Reply
jr204
Nintex Newbie

Re: Set value in choice column

Thanks for the quick and thorough response.  I noticed a few differences in the advanced settings of the button and have applied those to my form as well.  But nothing that I think would prevent the javascript from running properly (enable in view mode, causes validation).

I've tried this again on a blank form for testing and I'm still encountering the problem where the alert comes up, but the checkboxes don't update.  Just out of curiosity, which version of forms are you running?  It looks like we're on NF 2010 v1.9.0.0.

I'll keep poking around, maybe for some older responses, to see if I can get this working.

Thanks again for all of your help so far!

0 Kudos
Reply