I have the following view parameter on a view
shiftPattern : [
{"dayName": "Monday", "shiftStart1": "08:00", "shiftStart2": "16:30", "shiftStart3": "00:00", "shiftEnable2": true, "shiftEnable3": true, "shiftNextDay3": true, "dayNumber": 0},
{"dayName": "Tuesday", "shiftStart1": "08:00", "shiftStart2": "16:30", "shiftStart3": "00:00", "shiftEnable2": true, "shiftEnable3": true, "shiftNextDay3": true, "dayNumber": 1},
{"dayName": "Wednesday", "shiftStart1": "08:00", "shiftStart2": "16:30", "shiftStart3": "00:00", "shiftEnable2": true, "shiftEnable3": true, "shiftNextDay3": true, "dayNumber": 2},
{"dayName": "Thursday", "shiftStart1": "08:00", "shiftStart2": "16:30", "shiftStart3": "00:00", "shiftEnable2": true, "shiftEnable3": true, "shiftNextDay3": true, "dayNumber": 3},
{"dayName": "Friday", "shiftStart1": "08:00", "shiftStart2": "15:30", "shiftStart3": "22:00", "shiftEnable2": true, "shiftEnable3": true, "shiftNextDay3": false, "dayNumber": 4},
{"dayName": "Saturday", "shiftStart1": "07:00", "shiftStart2": "19:00", "shiftStart3": "21:00", "shiftEnable2": true, "shiftEnable3": false,"shiftNextDay3": false, "dayNumber": 5},
{"dayName": "Sunday", "shiftStart1": "07:00", "shiftStart2": "19:00", "shiftStart3": "21:00", "shiftEnable2": true, "shiftEnable3": false,"shiftNextDay3": false, "dayNumber": 6}
]
When I pass it into my Project Library function I have a problem.
return shiftPattern
seems to give me the whole list.
return shiftPattern[0]
gives me what I expect (although without string quotes):
{dayName: Monday, shiftStart1: 08:00, shiftStart2: 16:30, shiftStart3: 00:00, ...}
return shiftPattern[0]['dayName']
gives me
Error_ExpressionEval("Error executing script for runScript() expression:<my script function name>
A similar problem was discussed on Qualified Value in Change Script Perspective. Playing around with the answers in that I have had success with
shiftPattern[0].value['dayName']
returning ‘Monday’.
Can anyone explain what’s going on?