spfx

React SPFx - Adding files to SharePoint list field using PnPjs

删除回忆录丶 提交于 2021-02-11 15:40:59
问题 I'm building an application using SPFx Webpart with React. On one of my components I have a form that the user can fill out. I'm using PnPjs to push the user's responses into my list field. Everything works as expected. I was looking at how to add a file or attachment field type to a list. I saw I can do it in the powerapps. So now in my "Product" list I have a field called attachments . When I attach files to that field from SharePoint's backend and then make a call to the list using PnPjs

How to use mgt-people-picker in react framework

痴心易碎 提交于 2021-01-29 14:46:38
问题 I'm trying to use mgt-people-picker inside my SPFx Webpart with React framework, and couldn't get the selected-people attribute work. I tried passing an array of graph user objects to it but no luck. When I tried to use document.querySelector('mgt-people-picker').selectUsersById(["id","id"]) it threw an error saying "Property 'selectUsersById' does not exist on type 'Element'" The documentation is quite limited and unclear and there isn't much reference that I could find. Can anyone tell me

Trying to get files from a SharePoint library and populate state React/SPFX

牧云@^-^@ 提交于 2021-01-29 14:22:03
问题 I am having trouble with populating state with files using the below code. The first getByTitle brings in the Id of the file but not the Name or CaseID column. The second getByName successfully brings in the name of the document, but how would I bring in the Id and the CaseID column as well? sp.web.lists.getByTitle("Case Documents").items.get().then((items: any[]) => { let returnedItems: IListCItem[] = items.map((item) => { return new ListCItem(item); }); this.setState({ ListCItems:

JWPlayer with SPFx

天大地大妈咪最大 提交于 2021-01-29 08:20:15
问题 We are trying to embed JWPlayer that has the capability to resume playback from where we last left in the article below https://www.jwplayer.com/developers/web-player-demos/resume-playback-with-cookies/ Was able to find the npm package to be installed , However there is no resource online that describes its usage either with react or SPFx. Would appreciate if anyone could help us out with the code samples or with an alternate technique to achieve this. Thanks in advance 来源: https:/

SPFx uploading and adding attachment to a list

让人想犯罪 __ 提交于 2021-01-29 05:30:16
问题 I am having some difficulty upload and attachment to a list item in sharepoint using the PNP/SP package. I dont have much experience with the input file component so I think I may be missing a step between the file upload html element and submitting the file to the SharePoint web service. So far I've tried to follewing the PNP example with a few changes https://pnp.github.io/pnpjs/sp/docs/attachments/ and tried a few different arguments but they all tend to result in 409 or 500 errors, one

Open a file directly in Teams from a tab

 ̄綄美尐妖づ 提交于 2021-01-25 07:04:58
问题 I have deployed a SharePoint webpart (SharePoint Framework) to Microsoft Teams. In this web part, I have a list of files that I want to open directly in Teams. I have tried to get the link from the "Files" tab (https://teams.microsoft.com/l/file/7FFA7D9D-CBF1-4679-9C80-76446AE11ABD?tenantId=0f48c6f4-52a5-4553-b476-4ee2ee0aecca&fileType=docx&objectUrl=https%3A%2F%2Fxyz.sharepoint.com%2Fsites%2FAZRTZ%2FShared%20Documents%2FGeneral%2FArchitecture%2FTest.docx&baseUrl=https%3A%2F%2Fxyz.sharepoint

Open a file directly in Teams from a tab

妖精的绣舞 提交于 2021-01-25 07:00:17
问题 I have deployed a SharePoint webpart (SharePoint Framework) to Microsoft Teams. In this web part, I have a list of files that I want to open directly in Teams. I have tried to get the link from the "Files" tab (https://teams.microsoft.com/l/file/7FFA7D9D-CBF1-4679-9C80-76446AE11ABD?tenantId=0f48c6f4-52a5-4553-b476-4ee2ee0aecca&fileType=docx&objectUrl=https%3A%2F%2Fxyz.sharepoint.com%2Fsites%2FAZRTZ%2FShared%20Documents%2FGeneral%2FArchitecture%2FTest.docx&baseUrl=https%3A%2F%2Fxyz.sharepoint

Working example for Graph Toolkit using SharePoint spfx, React and Get component with template

若如初见. 提交于 2020-12-15 05:41:29
问题 I'm trying to make use of the Microsoft Graph Toolkit inside my SharePoint spfx web part solution, and more specifically the React version (@microsoft/mgt-react). I've managed importing the packages, and also render the control correctly. However I am now trying to render controls based on the result from a control. Something like this: const MyPerson = (props: MgtTemplateProps) => { const { person } = props.dataContext; return <Person userId={person.userPrincipalName}></Person>; } And here