cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SomeGuyNeedHelp
New Member

Update calculated sharepoint list column with HTTP request.

Hi People,

 

I've been trying to update a calculated column in my SharePoint list using a HTTP request flow;

SomeGuyNeedHelp_2-1653428173659.png

I got through an error to do with a missing colon after 'type', however now I'm getting the following error and it has me stumped;

Invalid JSON. A comma character ',' was expected in scope 'Object'. Every two elements in an array and properties of an object must be separated by commas.

 

{
  "status"400,
  "message""Invalid JSON. A comma character ',' was expected in scope 'Object'. Every two elements in an array and 
   properties of an object must be separated by commas."
,
  "source""/_api/web/lists/getbytitle('Tracker')/fields/getbytitle('Days%20Open')",
  "errors": [
    "-1",
    "Microsoft.SharePoint.Client.InvalidClientQueryException"
  ]
}

 

The 'Days Open' field is a calculated number that counts the number of days since an item was created and I was hoping to update this at the end of each day. I did try going down the 'Update Items' route instead, however this timed out as the list is getting quite large now.

7 REPLIES 7
Pstork1
Dual Super User
Dual Super User

That REST call is used to update the formula for the column, not the value.  Since its a calculated column I don't think it will update the value even if you update the formula until the item is edited.  It would be much better to replace the calculated column with a regular column and use Update item each day to update the value.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks for the heads up, I didn't know that was the case.

How could I utilise a normal column here without using 'Today()' in a calculated column?

Apologies if this seems like a simple question, I'm new to the platform.


Thanks

Just make it a single line of text column and set the value the way you were planning to with a flow.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks for the reply, I have tried this however the same error is cropping up;

 

Invalid JSON. A comma character ',' was expected in scope 'Object'. Every two elements in an array and properties of an object must be separated by commas.

 

Can you help me understand why I might be getting this error and how to overcome it?

Thanks

If you make it a single line of text field you can use the regular update Item action and won't need the HTTP anymore.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks, I should have mentioned but I did try this first, it timed out due to the size of the list (200+ items). Are their any more nice solutions to this problem? Thanks

I don't know of any other way to update the value of one column in all the items in a list.  That's why calculated columns only update when the item is edited.  I assume you are using a loop for the update.  Did you enable concurrency on the Loop?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,191)