Unable to find custom list template and differentiate custom template list and normal list?

Yuvraj Patil 441 Reputation points
2023-01-26T16:31:58.53+00:00

Hi,
I have created a list custom template from PowerShell utility (Used script from here [https://learn.microsoft.com/en-us/sharepoint/lists-custom-template). Now I am able to see new custom template in 'From your organization' during list creation [refer attachment] and, I am able to create the using custom template and use the list.
Till here everything is okay. Now I have 2 problems here:
Problem 1- I am using CSOM for operations, so unable to get the custom list template using csom. I have tried 'Web.ListTemplates' and 'site.GetCustomListTemplates(web)' return result of both does not contain the custom list template so how am I supposed to use this for list creation from CSOM? Is it list template is created at tenant level and not any site collection/site level? help here to access the created list template to create the list using csom.
Problem 2- When I create a list using custom template and create a normal generic list (Blank list option) then how can I find which template the list referring? is there any property or anything using which I can find the template list is referring to? I looked at 'TemplateFeatureId' and 'TemplateTypeId' which have same values for custom template list and normal list, how I can differentiate them?
Thanks in advance !
Attach1

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Windows for business | Windows Server | User experience | PowerShell
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.