2

As UrlQueryParameterCollection is deprecated, I suggest to use the URLSearchParams browser API instead. Here is my code to get value of search parameter: const url = new URL(window.location.href); const params = new URLSearchParams(url.search); let searchParam: string; params.has('search') ? searchParam = params.get("search") : searchParam = "&...


1

I would suggest you to follow below Microsoft documentation to use theme colors in your SharePoint Framework customizations: Use theme colors in your SharePoint Framework customizations You can also check all the available theme color values on your SharePoint site by typing __themeState__ into the console. The variables for use in the styles come from ...


1

My test code: import * as React from 'react'; import styles from './ReactPnpSpfx.module.scss'; import { IReactPnpSpfxProps } from './IReactPnpSpfxProps'; import { escape } from '@microsoft/sp-lodash-subset'; import { Web } from "sp-pnp-js"; export default class ReactPnpSpfx extends React.Component<IReactPnpSpfxProps, any> { constructor(...


1

While adding item to SharePoint list, we need to use the internal name of the column. Check the internal name of your RequesterEmpID column using below link and use it in your code: Find the internal name of SharePoint column


1

Here is the working code I tried to create a choice field with Fill-in choices allowed using SharePoint REST API: HTML: <button type="button" onclick="createField()"> Create Choice Field </button> JS: <script type="text/javascript" src="/sites/SPConnect/SiteAssets/jquery.min.js"></script> <...


1

You need to set the FillInChoice property to true. Here is the documentation for the property. https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-csom/ee539355(v=office.15) Here is the FieldChoice object in Fiddler for a field that has this property enabled. Since you're using odata=verbose, you'll also need to set the metadata for the ...


1

For that, there are two fields: Created By - This field stores the user who has created/added the list item. Modified By - This field stores the user who has modified/edited the list item. When a new list item is added/created, the user is same in 'Created By' and 'Modified By' fields. Thus instead of using a new user field, you can use one of them which ...


1

Kelank, Try calling the setup method once in your web part. It would look something like this: sp.setup({ sp: { headers: { Accept: "application/json;odata=verbose", } } }); You can find out more at: PnP/PnPJS - Getting Started I hope this helps?


1

If the fields are required, then you'll have to provide them. However, I suspect that the fields aren't required but you're trying to set them with undefined or something similar. It's a little difficult to tell with the information provided. I'm guessing the issue is with the way you are building the body object. Try only initializing it with the required ...


1

I guess you have probably solved this in the meantime, but for others coming across this post like I did today: This seems to be an issue with the latest TypeScript Version that might have probably been updated. Details here: https://dreamsof.dev/2020-09-21-typescript-upgrade-breaking-dataversion-get-override-spfx11/ And in short: Either fix it by using an ...


Only top voted, non community-wiki answers of a minimum length are eligible