cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marial16
Post Partisan
Post Partisan

Create calculated field with http request

Hallo,

 

I have created a flow that creates Lists in SharePoint. One of the columns is calculated.

I know the type of the column, but is there a way i can automatically create the calculation itself?

Example

 

marial16_0-1656513620342.png

 

marial16_1-1656513648437.png

 

marial16_2-1656513692409.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @marial16,


You can use the SP.FieldCalculated type in your metadata. 


Below is an example of that approach.

In this example I am also setting the output as a number. If you want to use text use the outputtype 1. 

https://docs.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.spfieldtype?view=sharepoint-server

 

 

{ 
"__metadata": { "type": "SP.FieldCalculated" }, 
"FieldTypeKind": 17, 
"Title":"TotalCost",
"Formula": "=Quantity*Cost", 
"OutputType": 9 
}

 

 

createcalculatedcolumn_restapi.PNG

View solution in original post

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @marial16,


You can use the SP.FieldCalculated type in your metadata. 


Below is an example of that approach.

In this example I am also setting the output as a number. If you want to use text use the outputtype 1. 

https://docs.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.spfieldtype?view=sharepoint-server

 

 

{ 
"__metadata": { "type": "SP.FieldCalculated" }, 
"FieldTypeKind": 17, 
"Title":"TotalCost",
"Formula": "=Quantity*Cost", 
"OutputType": 9 
}

 

 

createcalculatedcolumn_restapi.PNG

Yes this works,

i figured it out eventually although i did not know about output type. 

I will add it also to the workflow.

 

Thank you!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,382)