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

Question

Question

Set Current User for a Field Assigned to a Team

asked on September 15, 2017 Show version history

Midstream in the business process, if a specific field is not filled in with an individual's name, it goes to the team. At that point in the process (when a user from the team accepts the task), I want to have the field fill in with the current user's display name:

However, when I (a team member) accept the task as my own, it does not fill in with my display name:

Any ideas why not? I'm sure it has to do with me opening first as a team member and then accepting the task as my own ... it apparently doesn't do another reload?!?! So now how do I get the field to fill?

1 0

Answer

SELECTED ANSWER
replied on September 17, 2017

Hi Gloria,

As you said this field was used in a previous step and was left empty, it would have carried value which is empty string. Carried value has higher priority than default value/calculated value, so the default value won't be filled.

If the form on this step is different than form used on previous steps, you could add additional field with current user token as default value. But if the form is the same, you need to use custom script to overwrite field value.

2 0
replied on September 18, 2017 Show version history

Created displayname and username fields and put in the current user's display name and user name in their respective fields. Then I put in the following javacscript to check on form open:

$(document).ready(function(){
//Check for Blank Displayname and Username and Fill with Current User
  if($('.structural input').val() == ''){
    $('.structural input').val($('.displayname input').val());
    $('.structuralUsername input').val($('.username input').val());
  }
});  //close document.ready

 

Works great!

1 0
replied on April 20, 2018

Gloria, could you help me tweak this for my process?  I copied yours over into my JavaScript and then changed the word "structural" to the name of my field that I wanted this to happen in, but it isn't resulting in the employee name in the field I targeted.  Can you spot what I may have done wrong?

$(document).ready(function(){
//Check for Blank Displayname and Username and Fill with Current User
  if($('.step_completed_by input').val() == ''){
    $('.step_completed_by input').val($('.displayname input').val());
    $('.step_completed_byUsername input').val($('.username input').val());
  }
});  //close document.ready

0 0
replied on April 25, 2018

I also set up the following Lookup Rule:

Maybe that's what's missing?

0 0

Replies

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

Sign in to reply to this post.