NESTED <<START>><<END>> IN WEBHOOK BODY

Hi again,
I’m struggling on how to make this code work.
It should select some row from a table holidays, and for each row, select rows from the table Registro (rows with same year and month ) and update them. I’m really new to Webhooks and JSON and I’m getting crazy on this!

{

“Action”: “Edit”,
“Properties”: {
“Locale”: “en-US”,
},
“Rows”: [
<<START: FILTER(“Festività”,AND(year([data])=YEAR(TODAY()),WEEKDAY([Data])<>1,WEEKDAY([Data])<>7))>>
{
<<START: FILTER(“Registro”,AND([Anno]=year([_THISROW-1].[Data]),[Mese]=[_THISROW-1].[Mese], or([Registro_Ore]=“Ore Ordinarie”,[Registro_Ore]=“Ore Straordinarie”)))>>
{
“Row ID”: “<<[Row ID]>>”,
“1”:“<<IF([_THISROW-1].[Giorno]=1,0,[1])>>”,
“2”:“<<IF([_THISROW-1].[Giorno]=2,0,[2])>>”,
“3”:“<<IF([_THISROW-1].[Giorno]=3,0,[3])>>”,
“4”:“<<IF([_THISROW-1].[Giorno]=4,0,[4])>>”,
“5”:“<<IF([_THISROW-1].[Giorno]=5,0,[5])>>”,
“6”:“<<IF([_THISROW-1].[Giorno]=6,0,[6])>>”,
“7”:“<<IF([_THISROW-1].[Giorno]=7,0,[7])>>”,
“8”:“<<IF([_THISROW-1].[Giorno]=8,0,[8])>>”,
“9”:“<<IF([_THISROW-1].[Giorno]=9,0,[9])>>”,
“10”:“<<IF([_THISROW-1].[Giorno]=10,0,[10])>>”,
“11”:“<<IF([_THISROW-1].[Giorno]=11,0,[11])>>”,
“12”:“<<IF([_THISROW-1].[Giorno]=12,0,[12])>>”,
“13”:“<<IF([_THISROW-1].[Giorno]=13,0,[13])>>”,
“14”:“<<IF([_THISROW-1].[Giorno]=14,0,[14])>>”,
“15”:“<<IF([_THISROW-1].[Giorno]=15,0,[15])>>”,
“16”:“<<IF([_THISROW-1].[Giorno]=16,0,[16])>>”,
“17”:“<<IF([_THISROW-1].[Giorno]=17,0,[17])>>”,
“18”:“<<IF([_THISROW-1].[Giorno]=18,0,[18])>>”,
“19”:“<<IF([_THISROW-1].[Giorno]=19,0,[19])>>”,
“20”:“<<IF([_THISROW-1].[Giorno]=20,0,[20])>>”,
“21”:“<<IF([_THISROW-1].[Giorno]=21,0,[21])>>”,
“22”:“<<IF([_THISROW-1].[Giorno]=22,0,[22])>>”,
“23”:“<<IF([_THISROW-1].[Giorno]=23,0,[23])>>”,
“24”:“<<IF([_THISROW-1].[Giorno]=24,0,[24])>>”,
“25”:“<<IF([_THISROW-1].[Giorno]=25,0,[25])>>”,
“26”:“<<IF([_THISROW-1].[Giorno]=26,0,[26])>>”,
“27”:“<<IF([_THISROW-1].[Giorno]=27,0,[27])>>”,
“28”:“<<IF([_THISROW-1].[Giorno]=28,0,[28])>>”,
“29”:“<<IF([_THISROW-1].[Giorno]=29,0,[29])>>”,
“30”:“<<IF([_THISROW-1].[Giorno]=30,0,[30])>>”,
“31”:“<<IF([_THISROW-1].[Giorno]=31,0,[31])>>”
}
<>,
“Row ID”: “<<[Row ID]>>”,
“Registrata”: “1”,
}
<>
]
}

Thank for any help !
Lucy

synax issue

},
“Rows”: [
<<START: FILTER(“Festività”,AND(year([data])=YEAR(TODAY()),WEEKDAY([Data])<>1,WEEKDAY([Data])<>7))>>

{ <<<<------ REMOVE THIS

<<START: FILTER(“Registro”,AND([Anno]=year([_THISROW-1].[Data]),[Mese]=[_THISROW-1].[Mese], or([Registro_Ore]=“Ore Ordinarie”,[Registro_Ore]=“Ore Straordinarie”)))>>
{

“31”: “<<IF(DAY([_THISROW-1].[Data]) = 31, 0, [31])>>”, “Registrata”: “1”

<>,
“Row ID”: “<<[Row ID]>>”,
“Registrata”: “1”,
} <<<<------ REMOVE THIS
<>

1 Like

And to be sure.. instead of writing

“6”:“<<IF([_THISROW-1]…” add a space after the “:” like

“6”: “<<IF([_THISROW-1]…”

1 Like

Hi @AleksiAlkio and @jambyc ,

forst af all thanks for your suggestions. I tried to implement them, but still get an error: "Error encountered in step with name [INSERISCI FESTIVITà ORE ORD]: Error: Failed to parse JSON due to After parsing a value an unexpected character was encountered: :. Path ‘Rows[0]’, line 1, position 70.. Invalid JSON value starts with: : “zHuzIY8t3W4KU6MqZhx667”,“1”: “30>”,“Row ID”: “3KpZBwSqJ94XeF_Tw2OTQb”,“1”: “30>”,“Row ID”: "vXxau

Even trying several changes, I always get the same error with different unexpected character. It seems that the issue is the kind of answer, like if the system doesn’t want to receive back a register line to edit… ? I have no more ideas how to solve it, but changing strategy :disappointed_face:

If you have suggestions will be glad and thankfull!

Cheers

Lucy