I am having an issue with an object not being written to within a message handler script in perspective.
Here is my script:
note = payload['note'] downtime = payload['plannedDowntime'] payloadLine = payload['line'] lines = self.view.custom.selectedLines lineNames =  #Get a list of the selected line names for lineName in lines: lineNames.append(lineName['line']) #Get the index of the payload line index = lineNames.index(payloadLine) lineUserInputData = self.view.custom.lineUserInputData system.perspective.print('TESTING--------------------') system.perspective.print(lineUserInputData) system.perspective.print(downtime) #Change the values based on the message handler response lineUserInputData[index]["Downtime_Goal"] = downtime lineUserInputData[index]["Notes"] = note system.perspective.print(lineUserInputData) #Set the objects as the changed values self.view.custom.lineUserInputData = lineUserInputData
Here is the object I am trying to update:
In my code I am able to pull in the object successfully. I can print it out correctly. I have checked that the payload coming into the handler script is correct as well as the index variable. The “downtime” variable is also correct when I print it. Yet, the object does not update. I have also tried copying the object into the script console and running the same code structure and it updates just fine. I also receive no error messages when this runs.