“I’d like to create a new SharePoint column with a Power Automate flow, is there some easy way to define its schema, e.g. using SP interface?”
There’s an older article explaining how to create a new SharePoint column from a Power Automate flow. You prepare the column schema, use it in the HTTP request, and a new column is created. While it’s just a few steps, the first one can be a tricky one. How do you create the column schema? How to define all the properties of the new column? Do you have to understand all the properties and set them all manually?
Get the schema from an existing column
While preparing the XML manually is one of the options, it’s not an easy one. Luckily, as many times before, you can use the existing user interface to do some work for you. In this case we’re talking about the preparation of the column schema.
Firstly, prepare the column exactly as you want it in some SharePoint list. It can be a separate SharePoint list that’ll just help you define all the column properties.
Secondly, use the HTTP request to SharePoint below to extract the column schema.
Method: GET
Uri:
_api/web/lists/getByTitle('<listName>')/fields/getByTitle('<columnName>')/SchemaXML
Note: <…> are placeholders, replace them including the < and >.
Extract the schema with an expression and use is to create copy of the column.
body('Send_an_HTTP_request_to_SharePoint')?['d']?['SchemaXml']
And the last step could be adding the column to a view.
Summary
As you can see, even a seemingly complicated task as creating schema of a SharePoint column can be simplified if you know what HTTP request to use in your Power Automate flow. You can create the column using the SharePoint interface, set all its properties by a few clicks, and then just extract its schema with the HTTP request above. The only prerequisite being that you must be avare that such HTTP request exists, which is the reason why I created the HTTP requests to SharePoint cheat sheet.
Can you do some articles that aren’t Sharepoint related? I think Power Apps is becoming more and more of an enterprise app building tool. Maybe how to work with Facebook Messenger (or other PVA chat channels) or how to build complex PVA flows and the gotchas
Hello Mark,
I might do some in the future if I meet a customer who’s interested in such things, but so far Power Automate and SharePoint is what interests most people.
Much appreciated if you can tell how can I extract all xml elements into one XML?