1

How do I select all the fields and expand a person lookup field using the pnp js library?

$pnp.sp.crossDomainWeb(addinweb, hostweb).lists.getByTitle("Sites").items.select('*').expand('Person Field').get().then(function (result) {
                //console.log(result);
                context.commit("setSites", result);
                resolve();
            });

1 Answer 1

1

you should know what exactly you looking for in Person/User so my guess is to try this Person/Title.

$pnp.sp.crossDomainWeb(addinweb,hostweb)
.lists.getByTitle("Sites")
.items.select('Person/Title')
.expand('Person')
.get()
.then(function (result) {
     //console.log(result);
     context.commit("setSites", result);
     resolve();
     });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.