web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to find custom Sit...
Power Automate
Answered

How to find custom Site WebTemplate ID in order to automate site creation Flow

(1) ShareShare
ReportReport
Posted on by 16

Hi!

 

I´m working on a Flow that will allow me to create a new SharePoint subsite on a list´s item creation. So far I have managed to get the Flow to work using the standard team site WebTemplate (STS#0) and the project WebTemplate ids (PROJECTSITE#0).

 

I´m using the "Send HTTP request to SharePoint" action that looks like this:

 

site creation flow 3.png

 

However I want to be able to create such sites using my own custom site template which I have already created and saved as such.

 

Here is the question:

I need to be able to locate the correct WebTemplate ID in order to feed that information to the HTTP action, I have followed several articles including this one: https://jamesdiblasi.wordpress.com/2013/08/17/sharepoint-2013-finding-your-custom-site-template-id/ in order to do so.

 

By following that I was able to retrieve what I though was my site´s custom Webtemplate ID which reads: 

 

"{662D1818-F781-416B-8474-DE74B9917DE1}#Acorde_projectTmpA"

 

However, when I change my Web Template from PROJECTSITE#0 to 662D1818-F781-416B-8474-DE74B9917DE1}#Acorde_projectTmpA the flow runs into an error. The output of the error shows the following:

 

{
"message": "Invalid file or arguments for the site template '662D1818-F781-416B-8474-DE74B9917DE1#Acorde_projectTmpA'.\r\nParameter name: WebTemplate\r\nclientRequestId: bd8074ce-8f8a-48e9-b729-37ca40aef70c\r\nserviceRequestId: a5a81f9f-3084-0000-497c-336584773c12",
"status": 400,
"errors": [
"-2147024809",
"System.ArgumentException"
]
}
 
Which, if I´m not mistaken, means that I´m entering a wrong value for my custom site WebTemplate. I have also tried to get this ID using PowerShell but it appears that the sites I have created using this template are not showing any WebTemplate ID:
 
site creation flow 4.png
Please guide me on where to find the custom web template ID in order to use it in my flow.
 
Thanks in advance.
Categories:
I have the same question (0)
  • Gristy Profile Picture
    2,429 on at

    have you tried: {662D1818-F781-416B-8474-DE74B9917DE1}

  • SoporteAcorde Profile Picture
    16 on at

    Hi,

     

    I answered to this post a few days ago but today I´m noticing that my response is not there so here it is again.

     

    I did try with {662D1818-F781-416B-8474-DE74B9917DE1} but the errors is the same. Today I talked to a Microsoft representative that told me that custom site template IDs are not supported which sounds weird to me since not been able to automate site creation with your own customized sites would be a big missed opportunity if you ask me.

     

    Any suggestions are more than welcome.

     

    Thanks

  • Gristy Profile Picture
    2,429 on at

    it is supported, i do not do it this way.

     

    i use plumsail actions, look them up they are very cheap and take all this complexity away

  • Verified answer
    SoporteAcorde Profile Picture
    16 on at

    Thanks @Gristy  but I´ve just figured it out.

     

    Here are the steps as a future reference:

     

    • First your need to run the following powershell in order to get your Template ID. Bear in mind that the list is affected by the language used when the template was saved, so change the language ID in case you use other languages besides English:

    $Username = Read-Host -Prompt "Please enter your username"

    $Password = Read-Host -Prompt "Please enter your password" -AsSecureString

    $Site = "Site URL"

    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($Site)

    $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username,$Password)

    $Context.Credentials = $Creds

    #List Custom Templates

    $Templates = $Context.Site.GetWebTemplates("1033","0")

    $Context.Load($Templates)

    $Context.ExecuteQuery()

    $Templates | Where {$_.Name -like "*{*" } | Select Name, Description

     

    Alternatively, you can used the method explained earlier, where you inspect the template from Site Contents in order to get the Template ID.

     

    • Second, update the Flow in order to match the language ID of your Template, in this case:

    { 'parameters':
    { '__metadata':
    { 'type': 'SP.WebInfoCreationInformation' },
    'Url':'@{triggerBody()?['Title']}',
    'Title':' @{triggerBody()?['Title']} ',
    'Description':'@{triggerBody()?['Title']}',
    'Language':'1033',
    'WebTemplate':'{662D1818-F781-416B-8474-DE74B9917DE1}#TEMPLATE_projectA',
    'UseUniquePermissions':false
    }
    }

     

    In my case, I was using language ID 3082 (Spanish) whereas my Template language was 1033.

     

    More information about this usefull Site Creation automation Flow can be found at

    https://veenstra.me.uk/2018/05/02/microsoft-flow-create-a-new-sub-site-using-microsoft-flow/

     

    Hope it helps somebody else.

    Regards,

    Alexander.

  • jrtraylor Profile Picture
    45 on at

    So once i find my custom template id, what do i use for the site address field at the beginning of the http request if i am not creating a subsite? Our company has decided to not use Subsites out of fear that Microsoft will be eliminating them at some point based on how Modern Sites now have the Hub system.  

  • GowthamKopram Profile Picture
    3 on at

    Thank you so much for this article, after much search landed in this article.

    Now am able to create new site in Power Apps using custom site template. 

  • BR1984 Profile Picture
    53 on at

    can you please provide some screenshot how you do ans how you fin the custom template id ?

    thank you

  • Githendra23 Profile Picture
    150 on at

    Hi !

     

    I also want to find what the template id of my website. I tried the commands you've provided but i don't understand, it doesn't show the template id.

    Githendra23_0-1654851700257.png

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard