Hey @mishav
I been struggeling for a bit know and im trying to figure out how i should set up the server script in backend.
I am sending in data in the form of a JSON object, lets say the property name is “myProperty”.
When I try to access this property by reading data.myProperty I get “undefined”.
I have tried to do
const indata = JSON.parse(data)
and then try to read indata.myProperty, but even this returns “undefined”.
How do I access the JSON object and its properties inside the Server script event?
JSON
“status” : “Not Started”,
“shiftID”:“50945649”,
“userId”:“1”,
“title”:“Waiter”,
“salaryCode”:“610”,
“team”:"Waiter ",
“userName”:"Pontus S. Lindroth ",
“accountantId”:“5”,
“baseSalary”:200,
“start”:1705044190811,
“end”:1705076590828,
“shiftStatus”:1,
“weekHours”:2218800,
“montHours”:4310400,
“employeeType”:“5”,
“records”:,
"supplements":[{
"id":"1",
"title":"Kvelds tillegg",
"salaryCode":"1",
"type":"From Hour to Hour",
"wageAdjustment":"kr (amount is added to exicting rate)",
"pcsValue":9,
"start":1677700800000,
"end":1679455800000,
"afterMinutes":"",
"duration":"",
"weekDays":"1, 2, 3, 4, 5",
"range":"",
“validFrom” : 1680300000000,
“vaildUntil” : 4107614400000,
“employeeTypes”:“”,
“teams” : “Waiter, Chef”