You are viewing limited content. For full access, please sign in.

Question

Question

assign multiple users with a drop down

asked on October 15, 2018 Show version history

Is it possible to assign a single task to multiple user with a single drop down value? This instance you would have a drop down with some text. The value for the drop down would be something along the lines of user A: domain\userName and user B: domain\userName or user@domain.com. This way if the single drop down value is placed in the assignment area for the business process it is assigned to the two users that are listed for the drop downs value? Can this be done without using teams?

 

drop down.PNG
drop down.PNG (26.28 KB)
0 0

Replies

replied on October 16, 2018

Hi Cristobal

 

You could place the Forms User names in  a Drop-Down.

You can add a 2nd drop down with the same user names, which is defaulted to blank value to avoid confusion.(so that if it was blank it would not incur and error) -

Alternatively this could be placed in a collection - then you can have more than 2 users and set a maximum amount of users.

You can then use the assign task to the user in the process diagram as the collection feild variable or the 2 separate drop down variables.

It is cleaner if you use the collection method as you only need to insert one variable which assigns it to multiple users and allows for a more streamlined deployment.

 

Hope this helps.

 

0 0
replied on October 17, 2018

The easiest way to do this is to have a dropdown like you said, but instead of placing the multiple users/values in there, instead make a javascript IF statement that will populate however many Single Line fields you need, JS says something like this:

IF dropdown = Business Office

FILL Person1_field = domain\Mary

FILL Person2_field = sam@domain.com

etc

Of course, you can make the Person1_field and Person2_fields hidden so no one can make changes but pay attention to choose to Save Data instead of Ignore.

Now for the code, assign the CSS of "dropdown" to your dropdown. Assign CSS of "user1" to your Person1_field, "user2" to your Person2_field....

$(".dropdown").change(function(){
    var dropdown = $(".dropdown select").val();

    if (dropdown == "Business Office"){
      $(".user1 input").val("domain\Mary");
      $(".user2 input").val("sam@domain.com");
      }
    else if (dropdown == "Human Resources"){
      $(".user1 input").val("nikki@domain.com");
      $(".user2 input").val("domain\paul");
      }
  });  

Alternatively, you can do it with a database and a lookup, but the above solution is probably simpler if you aren't familiar with Databases.

 

Hope that helps

0 0
replied on February 8, 2021

I have the same question as Cristobal. I tried adding the JS you have given but I am not sure where to assign the CSS code of "user1" to your Person1_field, "user2" to your Person2_field. Would you be able to add more clarification on that? 

 

Thank you

0 0
replied on February 9, 2021

The Drop down needs the CSS class of dropdown.

These are fields which have been given the CSS class in the advanced tab of the Single Line Field, be cautious of setting these to read only, as JavaScript will not be able to write to them.

This will then populate the values of those fields with the corresponding data, ie field1 with "domain\mary" and the second field2 will be another field with "email@email.com"

0 0
replied on March 21, 2023

Hello all,

I came upon Lidija Bell's answer when searching for a way to assign multiple users to a dropdown.  I am using the JS/CSS as described, but can't get it to work.  Here's what I've got: 

$(".dropdown").change(function(){
    var dropdown = $(".dropdown select").val();

    if (dropdown == "Test"){
      $(".user1 input").val("donnie.xxxx@xxxx.xxx");
      $(".user2 input").val("david.xxxx@lxxxx.xxx");
      }
    else if (dropdown == "xxxxxxxxxxxxxxxx"){
      $(".user1 input").val("PROD\laserfichexx");
      $(".user2 input").val("membership@xxxxxxx.org");
      }
  });  

If anyone can ID something I've done wrong and could help me with this, I would greatly appreciate it.

Donnie
 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.