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

how do I get the user account login id from a lookup column people field?

Jump to solution

If I do a lookup() to another list to retrieve a Person field - in this case branch manager, I get a value

4661#;John Doe

How do I get the account name etc to set a people picker field on the form?

0 Kudos
Reply
2 Replies
mlauer
Nintex Newbie

Re: how do I get the user account login id from a lookup column people field?

Jump to solution

Set "Show field" attribute to "Account" in SharePoint list column settings for the Person field to get account by lookup function.

If You need also Name attribute in SharePoint list, You can create a list workflow to set one field based on the value of the other field when item is created or modified.

Reply
idicker
Nintex Newbie

Re: how do I get the user account login id from a lookup column people field?

Jump to solution

So I tried that - and it does work - however for some reason it looks like no value is returned for users who have not signed into the site collection. So I ended up using the SP REST API to load the data

NWF$.ajax({
        url: url + "/_api/web/lists/getbytitle('" + listname + "')/items(" + id + ")",
        method: "GET",
        headers: { "Accept": "application/json; odata=verbose" },
        success: function(data) {
            // Returning the results
            var person = data.d.BranchManager;
            var obj = JSON.parse(person);

            var ins = new NF.PeoplePickerApi('#' + peoplePickerCntrl);
           
            ins.search(obj.ID).done(function(data) {
                ins.clear();
                ins.add(data[0]);

            });
        },
        error: function(data) {
            alert("Failed");
        }
    });
0 Kudos
Reply