A few weeks ago, I need to change a content type from SharePoint into another one. There are a few alternatives to do either by using a custom solution, Power Automate and/or logic apps. The idea was when an item is created change the content type from x to y.
To achieve this, you have 2 different options:
- When an item is created your Flow runs and it contains a control that either changes the content type or ignore the item created.
- When an item is created you check the content initial content type and your Flow runs if the item is created with a specific content type.
We selected the option number for this case because it will be more efficient for our scenario however both options are fine.
This flow will change the Repost News to our own Content type called Custom News. For that, you can see the flow.
To only trigger once on the Action When an item is created follow the steps:
Under the trigger and conditions, put the follwing code, if you need to adapt to your own content type just change Repost Page with your content type name.
@equals(triggerBody()?['{ContentType}']?['Name'], 'Repost Page')
This blog is part of SharePoint Week. For more great content, click here
My name is David Ramalho and I’m currently part of Storm Technology Ltd family where I’m part of the Modern Workplace team.
In the past, I worked at BindTuning as a Support engineer and then as SharePoint development. The reason for creating this blog is to share tricks that can help on a daily basis for managing your SharePoint in different areas.
All the tricks, comments are welcome and feel free to contact me in case those tricks help, could be improved, say hello, etc.
Reference:
Ramalho, R. (2021). Change a SharePoint content type using Power Automate. Available at: https://sharepoint-tricks.com/create-multiple-sharepoint-sites-using-csv-file/ [Accessed: 14th September 2021].