cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Create a new column in SharePoint list from Flow

Hello all,

 

So I have pre-existing lists that I would like to automate the process of creating a new column on. Can you automate this process with Microsoft Flow?

 

More Details:

I have about thirty lists that I would like to not have to manually go into and create two new columns, as mulitple sources will continue to create more lists overtime. The photo attached shows the two columns I create highlighted in red ink.Screenshot of ColumnsScreenshot of Columns

All help is appreciated!

 

Update: This link provides great examples for accomplishing this type of thing https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn6001...

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Create a new column in SharePoint list from Flow

Hi @Anonymous ,

 

Yes need to include the JSON request. Please see below. Here I am creating a new text column called 'Country' with field length 25 under the list called 'aj'.

 

sp2.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

7 REPLIES 7
Highlighted
Dual Super User III
Dual Super User III

Re: Create a new column in SharePoint list from Flow

Hi @Anonymous 

 

Creating a column in a sharepoint list is not supported as a direct action in flow currently. What you can do is, to create the two columns in every list in your sharepoint site, you can invoke the rest api using the "send an http request" to sharepoint action and create those columns. Here is an example of how you can invoke the rest api to create a column:

https://www.c-sharpcorner.com/article/how-to-create-column-in-a-list-using-rest-api-in-sharepoint/

More on SharePoint rest api options: 

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/complete-basic-operations-using-sharepoint-rest-endpoints

 

The flow configuration can be: Manual button trigger -> Get Lists from Sharepoint Action -> Apply to each on the List returned -> send an http request to sharepoint.

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Anonymous
Not applicable

Re: Create a new column in SharePoint list from Flow

So, I can include non-JSON code into the body of a "Send Https request to Sharepoint" and populate the list with the two newly created columns (ex. pulling code from the link's example)? Or, are you saying I need to use the request to call an outside SharePoint Custom Add-in that is created similar to this: https://www.c-sharpcorner.com/article/how-to-create-column-in-a-list-using-rest-api-in-sharepoint/ to achieve the creation of columns?

 

@yashag2255 

Highlighted
Super User III
Super User III

Re: Create a new column in SharePoint list from Flow

Hi @Anonymous ,

 

Yes need to include the JSON request. Please see below. Here I am creating a new text column called 'Country' with field length 25 under the list called 'aj'.

 

sp2.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Re: Create a new column in SharePoint list from Flow

Hi @Anonymous 

 

You can refer to @abm 's suggestion for the send an HTTP request to sharepoint action. You can variabalise the column names / use the dynamic selector if you want to extract those from elsewhere.  

 

You can get more details on the column types and sending http request to invoke the SharePoint REST API from the URL's that I have shared earlier. 

 

More on column types etc. here: 

https://support.office.com/en-gb/article/list-and-library-column-types-and-options-0d8ddb7b-7dc7-414d-a283-ee9dca891df7

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Power Participant
Power Participant

Re: Create a new column in SharePoint list from Flow

Hey all

 

 

Some more information on the different FieldTypes could come in handy for this one I think 🙂

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj245640%28v%3doffice.15%...

 

Kind regards

 

Tom Slosse





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Highlighted
New Member

Re: Create a new column in SharePoint list from Flow

Is there any way to make the column visible by default?  The HTTP request worked for me, but the new column is hidden.

Highlighted
Super User III
Super User III

Re: Create a new column in SharePoint list from Flow

Hi

 

Once the column is created you need to execute another HTTP POST

 

http://<sitecollection>/<site>/_api/web/lists(listid)/Views(viewid)/ViewFields/addViewField(strField...

 

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj246043(v%3Doffice.15)

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,077)