JSON Formula Error [ =Date() ]

%3CLINGO-SUB%20id%3D%22lingo-sub-3206194%22%20slang%3D%22en-US%22%3EJSON%20Formula%20Error%20%5B%20%3DDate()%20%5D%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3206194%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20%3CSTRONG%3Ecolumn%20date%3C%2FSTRONG%3E%20which%20was%20working%20with%20JSON%26nbsp%3B%20%22customRowAction%22%20%26gt%3B%20%22%3CSTRONG%3EActionInput%3C%2FSTRONG%3E%22%20until%20some%20days%20ago%2C%20but%20suddently%20simply%20got%20me%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22teixeire40_0-1645647553002.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F350797i618347EB8DE2A743%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22teixeire40_0-1645647553002.png%22%20alt%3D%22teixeire40_0-1645647553002.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAs-is%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%22%3DDate(getDate(%40now)%20%2B%20'%2F'%20%2B%20(getMonth(%40now)%20%2B%201)%20%2B%20'%2F'%20%2B%20getYear(%40now)%20%2B%20'%20'%20%2B%20substring(toLocaleTimeString(%40now)%2C%200%2C%205))%22%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20try%20to%20choose%20the%20value%20myself%2C%20I%20has%20the%20same%20exactly%20structure%20defined%20inside%20formula%20%3DDate()%20as%20above%2C%20but%20it%20is%20only%20use%20it%20and%20I%20had%20the%20error.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20I%20try%20to%20use%20the%20same%20formula%20in%20%22%3CSTRONG%3EtxtContent%3C%2FSTRONG%3E%22%20I%20also%20have%20the%20same%20error%20as%20above.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3EI%20also%20tried%20using%26nbsp%3B%40now%20and%20has%20the%20same%20issue.%3C%2FLI%3E%3CLI%3EI%20also%20tried%20using%20the%20same%20structure%20of%20the%20Regional%20Locale%20set%20up%20for%20the%20SharePoint%20(which%20is%3A%20United%20States)%20and%20I%20also%20have%20the%20same%20issue.%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3CBR%20%2F%3E%26gt%3B%26gt%3B%26gt%3B%26gt%3B%20I%20have%20tried%20many%20other%20ways%2C%20as%20below%2C%20and%20nothing%20works%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2Digits%20Day-Month%20(test)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%22%3DDate(padStart(toString(getDate(%40now))%2C2%20%2C'0')%20%2B%20'%2F'%20%2B%20padStart(toString(getMonth(%40now)%2B1)%2C%202%20%2C'0')%20%2B%20'%2F'%20%2B%20getYear(%40now)%20%2B%20'%20'%20%2B%20substring(toLocaleTimeString(%40now)%2C%200%2C%205))%22%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3206194%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EJSON%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Lists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I have a column date which was working with JSON  "customRowAction" > "ActionInput" until some days ago, but suddently simply got me the following error:

 

teixeire40_0-1645647553002.png

As-is

 

"=Date(getDate(@now) + '/' + (getMonth(@now) + 1) + '/' + getYear(@now) + ' ' + substring(toLocaleTimeString(@now), 0, 5))"

 

 

When I try to choose the value myself, I has the same exactly structure defined inside formula =Date() as above, but it is only use it and I had the error.

If I try to use the same formula in "txtContent" I also have the same error as above.

 

  1. I also tried using @now and has the same issue.
  2. I also tried using the same structure of the Regional Locale set up for the SharePoint (which is: United States) and I also have the same issue.


>>>> I have tried many other ways, as below, and nothing works:

 

2Digits Day-Month (test)

 

"=Date(padStart(toString(getDate(@now)),2 ,'0') + '/' + padStart(toString(getMonth(@now)+1), 2 ,'0') + '/' + getYear(@now) + ' ' + substring(toLocaleTimeString(@now), 0, 5))"

 

 

2 Replies
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'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-...