Pnpjs: Implement fix for getting term label name instead of id for single value managed metadata field

Created on 9 Nov 2018  路  3Comments  路  Source: pnp/pnpjs

Category

  • [x] Enhancement

    Version

Please specify what version of the library you are using: [ 1.2.5 ]

Please specify what version(s) of SharePoint you are targeting: [ SP 2013 ]

I am getting all field values of a list item using below method:

  pnp.sp.web.lists.getByTitle(libName).items.getById(8).get().then((item) => {
        console.log(item);
});

Expected / Desired Behavior / Question

The returned object contains the look up id for Managed metadata fields instead of the label name. This is a longstanding issue with SharePoint REST endpoint which Microsoft has not fixed yet but there are some workarounds to this problem.
image

Workarounds are discussed over this StackExchange post.

code answered question

Most helpful comment

Hi @unnieayilliath,

Unfortunately, it can't be fixed in the library. This is REST API behavior. But you can leave a user voice for it here.

As a workaround renderListData (works for SP 2013) or renderListDataAsStream (SP 2016+) methods can be used.

All 3 comments

Hi @unnieayilliath,

Unfortunately, it can't be fixed in the library. This is REST API behavior. But you can leave a user voice for it here.

As a workaround renderListData (works for SP 2013) or renderListDataAsStream (SP 2016+) methods can be used.

@koltyakov Thanks for pointing me to renderListData , I had already up-voted the user voice , but it's been years idk why this can't be fixed at REST API

Going to close this as answered. If the conversation needs to continue please _reopen_ the issue so we can assist. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SpliceVW picture SpliceVW  路  3Comments

AJIXuMuK picture AJIXuMuK  路  3Comments

bogeorge picture bogeorge  路  3Comments

simonagren picture simonagren  路  3Comments

DennisGaida picture DennisGaida  路  3Comments