2

I am building an SPFx Application Customizer for a Powell365 project, and trying to have it use custom properties from the current site collections's property bag.

I already managed to get these properties in SP PowerShell, using the code linked below. How can I access those values in my SPFx Applicaton Customizer, and what are the modules I need to import?

The code from PnP JS - SP Webs throws a Type error:

"Object does not support the property or method "from".

Any support will be appreciated! Please let me know if I can supply more information.

Get complex properties:

import { sp } from "@pnp/sp";
sp.web.select("AllProperties").expand("AllProperties").get().then(success=>{[...]},error=>
{[...]})

PowerShell Script: SharePoint Online: Get-Set Property Bag Values with PowerShell.

1 Answer 1

3

Looks like you are using this in Internet Explorer.

You need to use a polyfill to use this in IE 11.

You can download the package using npm install --save @pnp/polyfill-ie11 command.

After that, you can import it in your code as below:

import "@pnp/polyfill-ie11";
import { sp } from "@pnp/sp";
sp.web.select("AllProperties").expand("AllProperties").get().then(success=>{[...]},error=>
{[...]})

Reference - PnPJS polyfills

2
  • Thank you, @gautam-sheth, this works just as desired.
    – danschdev
    Sep 27, 2019 at 11:22
  • Welcome, you can accept it as answer by ticking the checkbox ! Cheers Sep 27, 2019 at 11:25

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.