SPFx
70 TopicsHow to know if I can trust an SPFX webpart?
I am in the process of implementing an spfx webpart but before I need to make sure it is not a security threat. From researching I was not able to find if there is any way to run a check or provide a validation that the webpart is safe for the organization as it does ask for Graph API permissions, I do not think there is any issues with it, but I need to be able to have cleareance. This is the webpart: https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-accordion-dynamic-section1.2KViews0likes3CommentsIssue while posting the request to Sharepoint list which has more than 5000 items.
Hi, I am using below code for my spfx soution to post my caml and getting beow 500 error. private getOpenstatus() { let _openCount: string = ''; let val="In Progress"; let camlQueryPayLoad: any = { 'query' : { '__metadata': { 'type': 'SP.CamlQuery' }, "ViewXml": "<View><Query><Where><Eq><FieldRef Name='Status' /><Value Type='Text'>"+val+"</Value></Eq></Where></Query><ViewFields><FieldRef Name='ID' /></ViewFields><QueryOptions /><RowLimit>5000</RowLimit></View>" } }; let spOpts = { headers: { 'odata-version': '3.0' }, body: JSON.stringify(camlQueryPayLoad) }; const queryString: string = "$select=ID&$filter=Status eq '"+val+"'"; let url: string = this.context.pageContext.web.absoluteUrl + `/_api/web/lists/getbytitle('IncidentDetails')/GetItems?$top=5000`; return this.context.spHttpClient .post(url, SPHttpClient.configurations.v1, spOpts) .then((response: SPHttpClientResponse) => { let lvlFive: string = ''; if (response.status === 404) { //Log.error('js-display-List', new Error('List not found.')); return []; } else { if (response.ok) { response.json().then((responseJson) => { console.log(responseJson); if (responseJson != null) { let length= responseJson.value.length; _openCount +=`<a class="nav-link active" data-toggle="tab" href="#open-incident">Open<span>(<span>${length}</span>)</span></a>`; this.domElement.querySelector('#openCountView').innerHTML = _openCount; //this.domElement.querySelector('#levelFive').innerHTML = lvlFive; } }); } } }); } Below is the Response from API with 500 code. { "odata.error": { "code": "-2147024860, Microsoft.SharePoint.SPQueryThrottledException", "message": { "lang": "en-US", "value": "The attempted operation is prohibited because it exceeds the list view threshold." } } } Could you please help me how can I fix it ? I need an urgent help and would be great if i can get the quick solution.511Views0likes0CommentsFetch Data from on premise Database, SAP HANA Cloud for SPFx adaptive card Extension
I am trying to achieve. looking for how to retrieve and store data on a database system deployed on-premise, such as an SAP HANA solution that has its own database through the custom Viva Connections ACE(Adaptive Card Extension) card which I am trying to create. To give you an idea an example a customer has a locally deployed payroll Management solution that uses a local database. I am trying to connect the ACE card to that database to display the payroll information for an Employee in the card which will be added to the Viva connections Dashboard inside Microsoft Teams.459Views0likes0CommentsFetch Data from on premise Database, SQL, Oracle, or SAP for SPFx adaptive card Extension
I am trying to achieve. looking for is how to retrieve and store data on a database system deployed on-premise, such as an SQL server, Oracle Database, or SAP solution which has its own database through the custom Viva Connections ACE(Adaptive Card Extension) card which I am trying to create. To give you an idea an example a customer has a locally deployed Leave Management solution that uses a local database let's say as an example an Oracle database. I am trying to connect the ACE card to that database to display the Leave information for an Employee in the card which will be added to the Viva connections Dashboard inside Microsoft Teams. And also the employee should be able to create new leave requests through the ACE card from Viva Connections inside Microsoft Teams.675Views0likes0CommentsnavigatedEvent is not loading in new site
When I switch between sites - Site A (eng) and Site B (polish), the navigation from term store is loading from Site A in Site B. I have called the navigatedEvent to render the navigation when switching between sites but somehow it is not triggering the navigation in Site B (polish). As it shows the navigation from english site for at least sometime. @override public onInit(): Promise<void> { Log.info(LOG_SOURCE, `Initialized ${strings.Title}`); super.onInit().then(_ => { console.log("super oninit called"); sp.setup({ spfxContext: this.context, defaultCachingTimeoutSeconds: 30, globalCacheDisable: false }); }).then((_) => { console.log("Sp Initilize"); this.context.application.navigatedEvent.add(this, this._renderPlaceHolders); }); return Promise.resolve(); } private _renderPlaceHolders(): void { console.log("NavigationApplicationCustomizer._renderPlaceHolders()"); console.log( "Available placeholders: ", this.context.placeholderProvider.placeholderNames .map(name => PlaceholderName[name]) .join(", ") );587Views0likes0CommentsDocuments uploaded to a SharePoint Online library using the REST API can no longer be opened.
We have documents (Word, Excel, PDF, png, jpg) that were uploaded to a SharePoint Online document library last month using the REST API from an SPFx web part. These documents could be opened in the browser or downloaded from the document library. Yesterday (1/17) we noticed that all of those documents (regardless of type) now show a file size of 15 bytes. When downloaded and examined, their contents is the following text: [object Object]. This is not happening with documents that were uploaded using the SPO GUI. Those documents have a normal file size and can be opened. Was there a change to SharePoint online in the last week that would render documents uploaded using REST to be modified/corrupted? Here are more details on the SPFx web part and REST endpoint that were used: SPFx version 1.16.0 example endpoint URL: https://<tenant>.sharepoint.com/_api/web/GetFolderByServerRelativeUrl('FacilityDocuments/Acton')/files/add(url='test.xlsx',overwrite=true)?$expand=ListItemAllFields using the web part context spHttpClient.post const request = { body: file }; const response: SPHttpClientResponse = await spHttpClient.post( endpoint, SPHttpClient.configurations.v1, request );1.1KViews0likes1CommentForward Files when uploaded from Teams to another server
Hi Fellow developers, I have a project requirement wherein whenever a file is being sent in the team channels of my organization, I want them to be immediately sent to another server for sanity scanning. Can this be achieved from SPFx for multiple lists as each channel will have its own list? I have already looked into the documentation and the best I could think of was having a provider-hosted add-in which will have Graph API's change notification subscription for all the lists associated with all the channels in the teams of my organization. However, it seems to me a not-so optimal approach. Is there a better way of achieving this which I could not figure out from the Sharepoint, Teams and Graph API Documentations? Please let me know, it will be a great help. Thank you!655Views0likes0Commentscan we skip spfx field customizer to render for a particular row if my condition satisfies
I have created a field customizer which basically masking the value in fieldA(It is a required field) by taking values from fieldB. Everything is working fine except if my fieldA and FieldB both have empty value then the end user is not able to see the Sharepoint mandatory column style like below I have used return statement but its not working. Given below the logic of my code: if(!fieldA){ return; //Here I want no rendering at all and show the default style as shown in picture but it is coming as blank } else if (fieldB == null || typeof fieldB =="undefined" || fieldB=="" || String(fieldB).trim().length ==0) { event.domElement.innerHTML=fieldA?.Label; } //in this condition I am checking if fieldB is null in that case I am keeping the original value is fieldA as no masking required else { event.domElement.innerHTML=`<div>${fieldB}</div>`; //In this case I am masking fieldB value in fieldA where both have values NanddeepNachan945Views0likes1CommentCan SPFX field customizer be applied to managed metadata type columns?
I have created a spfx field customizer which works fine with all column except managed metadata type column. Is there any limitation to that or there is some issues with my code? @NanddeepNachan Do you have any idea on this?2.1KViews0likes5Comments