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

Re: Nintex Forms Managers name into people picker

Jump to solution

Hi John,

In the formula control, change the recalculate option to either to New mode.Then the formula calculation is fired once.

CheersPramod

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Managers name into people picker

Jump to solution

Hi Pramod,

Thanks for your suggestion. 2014-12-15_1506 - JohnLuangco's library 

That's something to think about so that the manager doesn't keep getting added when people view or edit a submitted form. My current problem revolves around the manager being added twice on the new form (before it gets submitted).

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Managers name into people picker

Jump to solution

John,

What about: Put a simple IF condition inside of your function to make sure it only fires once. This could be something as simple as an incremented int value to check against to see if it already fired.

-Mike

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Managers name into people picker

Jump to solution

Thanks Mike. I did try to put a catch in there so that it only fires once. However what I found was that the function is called and run at the same time as opposed to running in a linear fashion. Might ask Nintex to see if this approach is supported.

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Managers name into people picker

Jump to solution

I know this is late, but we have had a very similar issue, and got around it without JS.  There are probably caveats around how we did it, but it works, and that's all that matters to me .

It's all around not requiring to have a people picker control to connect to the list item directly, but rather a calculated control calculating the boss name from the people picker control (using userprofileLookup).  It is then connected to the text item, and most importantly is that the workflow works on the value in the connected text item.

0 Kudos
Reply
Not applicable

Re: Nintex Forms Managers name into people picker

Jump to solution

Hi, Nick Hurst​, as Mike says, if you think this is resolved, please mark the "correct answer." It helps the community.

Thanks!

0 Kudos
Reply
Not applicable

Re: Nintex Forms Managers name into people picker

Jump to solution

Hi

i know this is a bit of a long shot as it has been a couple of years since you posted this, but your solution is exactly what I am after. Im pretty new Nintex and i have managed to get it to select the current users manager, but I cant work out how to get it to select the manager of the person listed in the other people picker. would anybody be able to help?

thanks

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Managers name into people picker

Jump to solution

Here is how I did it....

  1. Add a Calculate Value to the form, and create a rule to hide it.
  2. Add this formula to the Calculated control: userProfileLookup( userProfileLookup(  Current User, "Manager"), "PreferredName")
  3. Add the javascript below to the form, change the control IDs (peoplecontrol, calculatedvaluecontrol) to your controls.
  4. The 750ms delay gives the Calculated control enough time to make the 2 userProfileLookup calls, 750 was a safe number and is not perceivable by users. You may have to increase it if you have a slow network, test test test.

 

NWF$(document).ready(function()

{

   NWF.FormFiller.Events.RegisterAfterReady(function()

    {

     setTimeout(function(){  

     var ins = new NF.PeoplePickerApi('#' + peoplecontrol);

     var currentuser = NWF$('#' + calculatedvaluecontrol).val();

     ins.search(currentuser).done(function (data)

     {      

        ins.add(data[0]);

      });

}, 750);

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Managers name into people picker

Jump to solution

you are missing the closing:

});

});

in your statement. Also how are you handling the function firing every time the user enters edit mode?

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Managers name into people picker

Jump to solution

In our situation that was not an issue because the control was only visible during New mode.

0 Kudos
Reply