Posts

Secure Power Automate flow to run from only specific domain

I had a HTTP triggered Power Automate flow and wanted to make it run only when the request comes from specific domain only. There were couple of ways but below suited. Open the Power Automate flow and click settings of the trigger. Put below conditions to check if the origin is same as your target domain. @equals(triggerOutputs()['headers']?['origin'],'https://mycompany.sharepoint.com')  Additionally in the same way, I put couple of more checks like below. @equals(triggerOutputs()['headers']?['mySecretKey'],'theSecretKeyGoesHere') Also, I had to make a check if the requests are generating from a browser only. @or(contains(triggerOutputs()['headers']?['User-Agent'],'Chrome'),contains(triggerOutputs()['headers']?['User-Agent'],'Mozilla'),contains(triggerOutputs()['headers']?['User-Agent'],'Edge')) This helped to to secure the requests generation from a specific client o

What is ODSP_DB Database in browser cache?

Image
What is ODSP_DB in browser cache and how SharePoint Online works with it? In SharePoint Online, Microsoft uses to store its Hub Navigation in  ODSP_DB  browser cache database. It contains various object that helps to build the primary navigation tree first and then on mouse over event the code fetches out the child components. Deleting the browser cache or directly this database actually forces SharePoint online to fetch new navigation. Check out below post on how to clear  ODSP_DB using client side code. SharePoint online hub navigation not updating for other users

SharePoint online hub navigation not updating for other users

Its been quite a time that I am working with SharePoint Online and meeting new challenges every day. Its feels great when you find a solution for something which Google do not tell you. I am just writing this post because there might be someone out there facing the same issue and this post might help him. BTW, before you check the actual post of how to fix the navigation check below, this might also help to change the user language. Problem Description: When an Admin of SharePoint Online site, updates the hub navigation (or may be site navigation), it do not get updated for all the users instantly. User has to clear browser cache to get the updated navigation. As per discussion with Microsoft, SharePoint saves a copy of the navigation in browser cache which automatically refreshes after a certain period of time. By default, you cannot clear browser cache using React or JS code. Browsers do not allow you to do so. So, the user should wait till that time? ABSOLUTELY NOT! (Imran Khan 😋 )

RangeError: Maximum call stack size exceeded | Node JS | SPFX React

Image
I literally had no idea that my minor experiment can ruin my 10 hours in troubleshooting. However, at the end, you learn something new. I am currently developing a project in SPFX - React to build a customized portal for a client. Later today i modified a config file in the SPFX project called "config.json" to include a new script file. Everything worked perfect until I stopped the debugging and start it again after some time. When I ran Gulp Serve I start seeing below error when Node tried to start "webpack" await Promise.all(externalModule.globalDependencies.map(async (dependencyName) => { RangeError: Maximum call stack size exceeded and some other errors like below. This is probably not a problem with npm. There is likely additional logging output above. npm ERR ! A complete log of this run can be found in : Googled around and found few solutions like clearing NPM cache with  npm cache clean --force and deleting package-lock.json,  then ran npm install ag

Copy SharePoint Online site pages from one site to another - Easy PowerShell Script

Image
There are several PowerShell scripts and multiple ways OOTB and using third party to copy SharePoint Online Pages from one site to another. However, sometimes it might become a hectic job when you are limited to use OOTB available features only.  I had to copy SharePoint Online site pages to another subsite, and here is the final script that I came up with. You need to download and install  SharePoint Online Management Shell from Microsoft web site and then run it as administrator. After that, copy below script (of course by updating the Source and Destination sites URL) in a notepad file, save it as .ps1 file and then just run this script.    $SourceSiteURL = "https://company.sharepoint.com/sites/ParentSite/ChildSite1" $DestinationSiteURL = "https://company.sharepoint.com/sites/ParentSite/ChildSite2" Connect-PnPOnline $SourceSiteURL -UseWebLogin $Files = Find-PnPFile -List "SitePages" -Match * foreach ( $file in $Files ) { Connect-PnPOnline

Failed to query the OAuth S2S metadata endpoint at URI - Workflow Manager 2013

Image
Since this is the backbone of SharePoint 2013 based workflows, I think Microsoft needs to make this application more mature and errors should be more clear and point to the root cause. Anyhow, that was just a suggestion, who cares. :) We have came across this error while it was working fine till yesterday. We removed the bindings and when it was needed to register the workflow again, this happened. Workflow Manager Error: WARNING: Overwriting existing scope named "SharePoint" in the workflow server. If another SharePoint farm was registered using this scope, that farm may not be able to continue working with the workflow server unless re-registered under another scope name. Register-SPWorkflowService : Failed to query the OAuth S2S metadata endpoint at URI ' https://mysitename.com/_layouts/15/metadata/json/1'.  Error details: 'An error occurred while sending the request.'. HTTP headers received from the server - ActivityId: 87239463-ea78-4ccc-81cd-a1ec0b903b

How to update preferred language (MUILanguages) in SharePoint Online using Power Automate

Image
This is pretty much something that I have not found in a direct way on internet so I thought I must write about it and make someone else's life easier someday. Scenario:  I have scenario where my customer has SharePoint Online portal with multilingual support and some custom developed web parts. During the development phase, the tenant was different and I was able to redirect user to MyAccount so he can change the preferred language,  but this setting was not available on customer's tenant. The reason was, we had Azure AD profiles while customer has synced them from local AD so this setting was not available. I recommend you to check out my this post about the language switch issue that I faced. Problem:   Since the manually preferred language change option was not available, we need to find another way where user can switch to any other language. In my case it was switch to Arabic from English. Solution Overview: Since the preferred way to make the language switch should be le