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

How to show the Display Name of Person or Group  using calculated Value..

Jump to solution

I am trying to show the display name of the any user using a Calculated value in intex form using the  source column as Person or Group, but is is not showing any value....

EmpName (Display Name) or EmpName (Email) are not working...  Simply EmpName is showing like the following i:0#.f|membership|abc@xyz.com

Labels: (3)
0 Kudos
Reply
9 Replies
Not applicable

Re: How to show the Display Name of Person or Group using calculated Value..

Jump to solution

Hi Vikash,

I have done similar things for O365 nintex form. Have a look on the below code.

var totalDomCheck=0;

var tmp;

NWF.FormFiller.Events.RegisterAfterReady(function (){ 

var ObjRequesterID = NWF$("#" + SalesRepClientID);

var objManagerID = NWF$("#" + RegManagerClientID);

//pollSP = setInterval(checkSPLoad, 2500);

//window.load(function(event) {

  //alert('window.load');

  //if (document.readyState == "complete") {

  //  alert(document.readyState);

   //checkSPLoad();

  //}

ObjRequesterID.change(function(){

getManager(ObjRequesterID,objManagerID);

});

})

function getManager(ObjReqID,ObjMngrID)

{

//******* This function gets the Manager from List 'Participant Configurations'********

var ManagerAccount;

alert('In getManager fucntion');

var clientContext= SP.ClientContext.get_current();

var web = clientContext.get_web(); 

var list = clientContext.get_web().get_lists().getByTitle("Participant Configurations"); 

if(ObjReqID.val()!="")

  {

var trequester=ObjReqID.val().split('|')[2];

alert(trequester.split(';')[0]);

var requesterEmail=trequester.split(';')[0];

var userRequesterInfo = web.ensureUser(requesterEmail);

clientContext.load(userRequesterInfo);

clientContext.executeQueryAsync(       

function (sender, args) {

var camlQuery = new SP.CamlQuery();

camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Person' /><Value Type='User'>"+userRequesterInfo.get_title()+"</Value></Eq></Where></Query></View>");

var items = list.getItems(camlQuery);

clientContext.load(items);

clientContext.executeQueryAsync(       

function (sender, args) {

var itemEnumerator = items.getEnumerator();

while(itemEnumerator.moveNext())

{

var item = itemEnumerator.get_current();

var userManagerInfo = web.ensureUser(item.get_item("Manager").get_email());

clientContext.load(userManagerInfo);

clientContext.executeQueryAsync(       

function (sender, args) {

var managerUserId = {"email": userManagerInfo.get_email(),"id": "9","label": userManagerInfo.get_title(),"title": "","type": "User","value": userManagerInfo.get_loginName()

};

ObjMngrID.data('uiItempicker')._addItem(managerUserId);

});   

}

});

});

}

else

{

if(ObjMngrID.val()!="")

{

var RManager=ObjMngrID.val().split('|')[2];

var managerEmail=RManager.split(';')[0];

var userMngrInfo = web.ensureUser(managerEmail);

clientContext.load(userMngrInfo);

clientContext.executeQueryAsync(       

function (sender, args) {

alert(userMngrInfo.get_loginName());

var managerRemoveUserId ={"data-val": userMngrInfo.get_loginName()};

ObjMngrID.data('uiItempicker')._removeItem(managerRemoveUserId);

});

}

}

}

NWF$(window).load(function() {

//delay SP.RequestExecutor.js

var ObjRequesterID = NWF$("#" + SalesRepClientID);

  var objManagerID = NWF$("#" + RegManagerClientID);

  getManager(ObjRequesterID,objManagerID);

        //tmp=window.setInterval(pollSP,5000);  

});

   

function pollSP()

{

     window.clearInterval(tmp);

     var ObjRequesterID = NWF$("#" + SalesRepClientID);

  var objManagerID = NWF$("#" + RegManagerClientID);

  getManager(ObjRequesterID,objManagerID);

}

0 Kudos
Reply
Workflow Hero

Re: How to show the Display Name of Person or Group using calculated Value..

Jump to solution

You can use the following formula in the calculated value in Nintex Forms :

userProfileLookup(EmpName,"PreferredName")

Hope this helps

0 Kudos
Reply
Not applicable

Re: How to show the Display Name of Person or Group  using calculated Value..

Jump to solution

Hi Caroline Jung,

Thanks for the answer, but it's not working... showing error userProfileLookup is not defined

0 Kudos
Reply
Workflow Hero

Re: How to show the Display Name of Person or Group  using calculated Value..

Jump to solution

This error may occur because you have SharePoint Foundation.

Do you have Nintex Forms Enterprise ?

0 Kudos
Reply
Not applicable

Re: How to show the Display Name of Person or Group  using calculated Value..

Jump to solution

No, I ma using Nintex trial version in Office 365.

0 Kudos
Reply
Workflow Hero

Re: How to show the Display Name of Person or Group  using calculated Value..

Jump to solution

ok, then it will be more difficult.

Why do you need to have the display name of a user or group in a calculated value ?

Is the user or group populated in a control in the form ?

0 Kudos
Reply
Not applicable

Re: How to show the Display Name of Person or Group  using calculated Value..

Jump to solution

I want to change the username in the form depending upon few calculations

0 Kudos
Reply
Workflow Hero

Re: How to show the Display Name of Person or Group  using calculated Value..

Jump to solution

I'm afraid that there is no other option than getting the display name in Javascript from the people picker (where it is displayed).

In the calculated value, you can call your custom javascript function (Re: Using Nintex Form Runtime Lookup Function to populate a textbox ) and you can return a value in the javascript function so that the calculated value can get it back.

Hope this helps

0 Kudos
Reply
Not applicable

Re: How to show the Display Name of Person or Group using calculated Value..

Jump to solution

I believe the issue is with the person or group column set to show "Account" name. Try changing it to "Name". Hope that helps.

0 Kudos
Reply