SharePoint Framework (SPFx)
5 TopicsHow to create custom section layout options for SharePoint online modern site pages?
Hello Everyone, SharePoint provides default layout options below as mentioned in the screenshot. How can we create custom section layout options as per our needs? If there are any ways to create custom section layout options then please let me know your thoughts on the same. Can anyone help me with the same? Thanks1.5KViews0likes1CommentSPFx app customizer not loading on using browser back button
Hi, I am having a simple SPFx app customizer to display the site owner information on all modern pages of SP2019 site. There are links on the page that take us to different sites that run on classic mode. Now when we try to click on back button to get back to the modern site page, the app customizer does not get displayed. But after we refresh that page once, it gets displayed. Any idea what would be causing this issue?744Views0likes1CommentSPFx webparts not able to acquire token for Graph API in Teams app (Viva Connections)
Hi all, There is a very strange thing happening to a few webparts that we've build for one of our clients. We haven't seen this problem in other tenants, it seems to be related to this specific tenant. Maybe it's a setting, or maybe it's a bug. Hopefully someone can help us. This is the case: We have created a SharePoint intranet site and made it the root site. We then added the site to the Viva Connections integration in Teams, as an app. On this site we have a couple of custom webparts that we created. One of the webparts have been used in many intranet sites and haven't had these problems so far. The problem also isn't occurring on SharePoint itself. The problem is connecting to the Graph API, the token doesn't seem to be retrieved and thus the API requests are not even send to the Graph API. Environment details: Microsoft Egde version 115.0.1901.183 (Official build) (64-bit) SPFx 1.17.4 Node 16.15.1 NPM 8.11.0 The error I'm getting: Uncaught (in promise) Error: Token request previously failed at new t (chunk.aadTokenProvider_en-us_445a72773ba77a61be93.js:1:1514) at e._getTokenInternal (chunk.aadTokenProvider_en-us_445a72773ba77a61be93.js:1:3567) at e.getToken (chunk.aadTokenProvider_en-us_445a72773ba77a61be93.js:1:2372) at sp-pages-assembly_en-us_c3c628b67d521769ee27f473c0ed9543.js:76:647657 The request that might be the problem: https://tenant.sharepoint.com/_api/Microsoft.SharePoint.Internal.ClientSideComponent.Token.AcquireOBOToken?resource=%27https://graph.microsoft.com%27&clientId=%2775aff87b-45bf-41e7-84f3-552901a72ea0%27 Results in an 500 internal server error with the following message: { "odata.error": { "code": "-1, System.AggregateException", "message": { "lang": "en-US", "value": "One or more errors occurred." } } } I found this issue #7884 which seems to be related to mine or at least gives the same error, but the resolution there doesn't apply here sadly. The manifest is already in the right format and with the correct data. Also cross referenced the manifest with other, working tenants At this point I have no clue on what the cause of the issue is, could any of you help me with this problem? Kind regards, ArjenSolved4.3KViews0likes4Commentshow to get SP site contents list ?but getting blank values from SP in SPFX webpart
Hi Team, I am trying to get SP Site contents list (Get SP lists) using React component framework but getting blank Please find the below code file //this is WebPart Render method File public render(): void { const element: React.ReactElement<IGetSpListsProps> = React.createElement( GetSpLists, { description: this.properties.description, websiteUrl: this.context.pageContext.web.absoluteUrl }); ReactDom.render(element, this.domElement); } //Component Interface file export interface IGetSpListsProps { description: string; websiteUrl: string; } //Component TSX file export interface IGetSpListsState{ sitecontents: [{"Lists":""}] } export default class GetSpLists extends React.Component<IGetSpListsProps, IGetSpListsState> { static siteurl:string =""; //static member variable public constructor (props :IGetSpListsProps, state:IGetSpListsState ){ super(props); this.state={sitecontents: [{"Lists":""}]}; GetSpLists.siteurl=this.props.websiteUrl; } public componentDidMount() { let reactcontexthandiler= this; jquery.ajax({ url: `${GetSpLists.siteurl}/_api/web/lists?select=Title&$filter=Hidden eq true`, type:"GET", headers:{'Accept': 'application/json;odata=verbose;'}, success : function (resultData){ reactcontexthandiler.setState({sitecontents: resultData.d.results}); }, error: function (jqXHR, textStatus, errorthrown){ } }); } public render(): React.ReactElement<IGetSpListsProps> { return ( <div> <ol> { this.state.sitecontents.map(function(mylists,mylistitemkey){ return( <li> <span>{mylists.Lists}</span> </li>); }) } </ol> </div> );}} Please find the output which it shows for the above piece of code please assist me why it shows blank416Views0likes0Commentscan 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 NanddeepNachan945Views0likes1Comment