Pnpjs: sp-taxonomy termSet.terms.get() - Guid should contain 32 digits...

Created on 13 Feb 2020  路  5Comments  路  Source: pnp/pnpjs

Category

  • [ ] Enhancement
  • [x] Bug
  • [ ] Question
  • [ ] Documentation gap/issue

Version

pnpjs and related 1.3.8
SharePoint Online

Expected / Desired Behavior / Question

I want to get the terms in a term set using pnp/sp-taxonomy

Observed Behavior

I'm using the following

const store = await taxonomy.termStores.getById(
      "3ad94806-8ab5-45d3-9070-41e8114beb5"
    );
    const termSet = await store.getTermSetById(
      "90c3932b-cac6-4d1c-a661-b2ddf9beba5a"
    );
    const terms = await termSet.terms.get();

this sends a request to ProcessQuery with the following body

<Request xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="PnPjs"><Actions><ObjectPath Id="1" ObjectPathId="0" /><ObjectPath Id="3" ObjectPathId="2" /><ObjectPath Id="5" ObjectPathId="4" /><ObjectPath Id="7" ObjectPathId="6" /><ObjectPath Id="9" ObjectPathId="8" /><Query Id="10" ObjectPathId="8"><Query SelectAllProperties="true" ><Properties /></Query ><ChildItemQuery SelectAllProperties="true" ><Properties /></ChildItemQuery ></Query ></Actions><ObjectPaths><StaticMethod Id="0" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Property Id="2" ParentId="0" Name="TermStores" /><Method Id="4" ParentId="2" Name="GetById"><Parameters><Parameter Type="String">3ad94806-8ab5-45d3-9070-41e8114beb5</Parameter></Parameters></Method><Method Id="6" ParentId="4" Name="GetTermSet"><Parameters><Parameter Type="String">90c3932b-cac6-4d1c-a661-b2ddf9beba5a</Parameter></Parameters></Method><Method Id="8" ParentId="6" Name="GetAllTerms"></Method></ObjectPaths></Request>

which results in the following response

[{
    "SchemaVersion": "15.0.0.0",
    "LibraryVersion": "16.0.19722.12035",
    "ErrorInfo": {
        "ErrorMessage": "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).",
        "ErrorValue": null,
        "TraceCorrelationId": "c10e359f-40c1-9000-7a74-5d4e200a0f7f",
        "ErrorCode": -1,
        "ErrorTypeName": "System.FormatException"
    },
    "TraceCorrelationId": "c10e359f-40c1-9000-7a74-5d4e200a0f7f"
}]
non-library not a bug question someting isn't working

Most helpful comment

Hm... weird, all I think of is tenant updates difference.
Checked on another tenant. It also works, even providing a GUID without dashes or /Guid(...)/ formats.

image

However, both tenants I've tried runs standard release strategy.
Can it be you have targeted release and something has been updated on the targeted server-side?

All 5 comments

Looks that's something wrong on your end. Probably wrong ids of something else MMD-related.
Confirming it should work and not a bug.

image

HI,

I got it to work now but I am a bit confused. For some reason I need to write the ids like this "/Guid(3ad94806-8ab5-45d3-9070-41e8114beb59)/". Any idea why this is needed for me but not for you?

Hm... weird, all I think of is tenant updates difference.
Checked on another tenant. It also works, even providing a GUID without dashes or /Guid(...)/ formats.

image

However, both tenants I've tried runs standard release strategy.
Can it be you have targeted release and something has been updated on the targeted server-side?

I have checked now and the tenant I tried with runs targeted release so that might be the reason then. Thanks for the help :)

hey @Abrissirba , could you close issue with this is resolved for you?
Thanks Val

Was this page helpful?
0 / 5 - 0 ratings