Friday, 16 September 2022

How to create custom create news button in SharePoint Online?

 Recently we were developing a custom news web part using SPFx. The functionality was required the same as the OOTB news web part. The only change was we needed a few more layout options as well we need to showcase a few more column details in the news web part. We build the remaining things as expected but we didn’t have any idea how to provide create a post button as the OOTB news web part provides.


So, our first approach was the lazy one. We find out a URL that will create a site page and we will train users to click “Promote as news” once the page is published.
URL – [SiteURL]/_layouts/15/CreateSitePage.aspx

But the issue is, Client didn’t agree to have a 2-click solution.


We got a blog from Shantha Kumar (link in description) that provided us an initial idea of the difference between a modern site page and a news post. Microsoft has put a parameter – “Promoted State” to differentiate the page creation.

Promoted State

Page Creation Experience

0 or null

This will create a Modern Site page.


This will create a News post in the draft version.


This will be the News Post in the published version.


In simple terms, if we hit the below URL, it will create the news post:

This solved the first half of the issue. But Microsoft has provided different experiences in news post creation. If you are creating news posts from site pages, it will create posts from a basic template directly. But if you are creating it from the home page or any news post, it will showcase template selection.

The client asked us if it is possible to open that pane with a button click. Here we needed to research some more and ultimately our savior stack exchange has an answer for that. The updated URL will look like the below:


As the information is scattered and hidden, I thought it would be useful to have this in one place. Hope this helps.  



Sunday, 11 September 2022

Visual Studio Code Prettier Extension Set up

Recently I needed to use the Prettier code formatter extension in visual studio code. I thought it would be similar to other extensions. But it is not. We need to set a setting for this extension to work automatically. We will go through that setting for the windows system in this blog.

Prettier Extension Set up

  • Open visual studio code as an administrator.
  • From extensions, install “Prettier – code formatter”

Once you have installed it, you can use it with CTRL + CMD + P (macOS) or CTRL + Shift + P (Windows) to manually format a file or a selection of code

Required Settings

We need to enable format on save settings for this extension. By default, it is disabled in visual studio code, and it is a manual setup.

Also, we need to set the Prettier extension as the default formatter.

Windows Machine set up

In windows, we can follow the below steps for the required settings:
  • Click settings. You will find it in the left bottom corner.

  • Click on Settings in the menu.

  • It will open the settings page. In that, click on the text editor.

  • Scroll down to “Default Formatter” settings.

  • Here, we need to select Prettier.

  • After this from the left menu click on “formatting”.

  • Here, checks the option “Format on save”.

Verify the changes

  • To verify the settings, click on the new text file from the file menu.

  • Click on select a language. Then select – HTML

  • Paste the below code and save the file.

 <head> <title>This is test</title> </head>  
 <body> <p>this is test</p> <p>This is test 2</p> <p>test</p> </body>  

  • When you save the file, it will be automatically formatted.

Final Comments 

With Prettier, the life becomes easy, and code becomes readable. However, be aware that this applies to every project now. If you happen to work on a project with a team where the project does not use Prettier, you will format every file once you save it. If not agreed upon with your teammates, this may cause trouble.

Friday, 12 August 2022

Power Automate URL Changes


Recently I got a query from a citizen developer about a message showing on the Power Automate home page that whether they need to worry about this or not.


Generally, I am not used to reading the warnings posted by Microsoft on the home page of Power Platform applications but as this was a query, I needed to look into it, and I found out that this might not be much worry on the first reading.


As it suggests in the message as well, when you click on the “Learn More” link, you will read similar stuff that Microsoft is changing the URL of Power automate from “” to “”.

Also, it is mentioned in the article that once the changes are done, Microsoft will route all the traffic requests to the new URL and users will be redirected to new URL. Though they suggest if they can update their bookmark, it would be useful to change it to a new URL.

Below are the new URL details provided by Microsoft:



Existing Power Automate URL

New Power Automate URL








For US Government Customers







For China Customers





But then I read it twice more to understand the impact on a bigger scale and it is actually a big change. Let’s say you have an IT administrator who has added IP config rules and is not allowing any other URL without prior approval from the network. This would break any flow running because the request would be coming from a new site and would be blocked.

This scenario can happen to Gateway connections especially. As it could be configured to interact with your local cloud.  It will also affect to US Government customers as it has strict URL policies.


So how do you know whether you will be affected by it or not?

There is a paragraph where Microsoft has mentioned that the image in the beginning of the post will be in red color if you are affected. This means you will be facing errors in your flow once the URL change will be implemented.

The following table lists the services to which Power Automate connects. Ensure none of these services are blocked on your network.





Access to the Azure Resource Manager.


Access to authentication and authorization endpoints.


Access to Microsoft graph - for getting user information such as a profile photo.



Access to the Runtime for Connectors.



Access to the Power Automate site.



Access to Power Automate site.



Access to the Power Apps site.



Access to the Power Automate CDN.


Access to NPS (Net Promoter Score).


Access to Office for header and search. Please see the Office 365 urls and ranges for more details.



Access to Dataverse tables


Access to the Power Automate to check for updates


Access to the Power Automate to check for updates


Access to the Power Automate for desktop cloud discovery



It is not necessary that you see red flags on Power Automate home as per my understanding.  This depends on Microsoft and Your company agreement and if your company has not provided access to your network detection, you may not see this red flag.


For more details, please refer to below link:

·         Power Automate IP address configuration


This change is scheduled for the end of June as per the article. Microsoft has only initiated new sites yet. But once they release the changes, sooner or later they will block the old URL. Before that Microsoft might change the banner's color or shoot an email thread. If you want to be prepared in advance you can perform the check on IP configuration. If you still face the issue, you can always generate a ticket with Microsoft for the same.