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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (3,751)