Forum Discussion
JSON Sharepoint List Action Button - update to today's date
I have a SharePoint list with a column button. When the button is pressed, based on other conditions, I want to update a SharePoint column (internal name SuspendEndDate) to the current date. SuspendEndDate is a date/Time column formatted as DateOnly, Standard format.
My format action on the button looks like this. What am I missing on the setValue for SuspendEndDate? Currently the column is not updating at all!
2 Replies
Hi Annette1101 - try using utcNow() first.
Otherwise, check out this post on dates, SharePoint and JSON: SharePoint Online Date calculation with JSON - Microsoft Community Hub.
My first instinct as I'm more familiar with Power Automate than JSON was to have the button kick off a flow, like this post explains JSON syntax clickable button to capture/record the time and date now - Microsoft Community Hub
Hope that helps!
- Annette1101Brass ContributorUnfortunately, utcNow() doesn't work! I am not inclined to kick off a Power Automate from the button as it would require the user to perform a few clicks. I do have a Power Automate that runs on a trigger when the status changes, based on a trigger, so I will add that field update to that flow instead of trying to change it with a setValue as it clearly doesn't work for a date field.