Forum Discussion
teixeire40
Feb 23, 2022Copper Contributor
JSON Formula Error [ =Date() ]
I have a column date which was working with JSON "customRowAction" > "ActionInput" until some days ago, but suddently simply got me the following error: As-is "=Date(getDate(@now) + '...
MarkBurrage42
Apr 26, 2022Copper Contributor
Sorry this is not a solution but a repetition.
I am also using a button > customRowAction > actionInput to update a date column by simply using @now. This worked fine until a little while ago then started showing the same error as above.
If anyone has any solutions it would really be appreciated.
Thanks Mark
I am also using a button > customRowAction > actionInput to update a date column by simply using @now. This worked fine until a little while ago then started showing the same error as above.
If anyone has any solutions it would really be appreciated.
Thanks Mark
MarkBurrage42
Apr 26, 2022Copper Contributor
I've just found a solution
"=getYear(@now)+'-'+(getMonth(@now)+1)+'-'+getDate(@now) + ' ' + toLocaleTimeString(@now)"
Very similar to that above but with date and year swapped which may have something to do with time settings. In any case it worked for me and I found it in this useful article
https://techcommunity.microsoft.com/t5/microsoft-365-pnp-blog/quick-sharepoint-approvals-using-list-formatting-json-to-set/ba-p/2984496
"=getYear(@now)+'-'+(getMonth(@now)+1)+'-'+getDate(@now) + ' ' + toLocaleTimeString(@now)"
Very similar to that above but with date and year swapped which may have something to do with time settings. In any case it worked for me and I found it in this useful article
https://techcommunity.microsoft.com/t5/microsoft-365-pnp-blog/quick-sharepoint-approvals-using-list-formatting-json-to-set/ba-p/2984496