A JSON Object should start with {. A JSON list start with [
Maybe that is already a clue. If not, can you add some screenshots of the flows you created?
@Tim van Steenbergen,
The screenshot as promissed:
I seem to have solved the issue, not sure about the root cause though. If someone knows the inner workings of Mendix, perhaps they can fill something in, but otherwise there might be a bug hidden somewhere.
The “Insurance” entity is an impersistent entity with data retrieved from an external API. The user can select which Insurance to get data from in a list in the UI. In my flows I take the selected insurance and work with it, along with data from other sources, in a JavaScript-file. In order to more simply work with the data I create a master object in the js-code, for example, an individuals insurance (2 sources) will be found via Contact.Insurance.
From what I can see the impersistent Insurance object was substituted with my modified JS version causing a crash. I cant really figure out how the system would “confuse” the two.
I changed how I iterate over the provided objects and “build” the master which made it work.
Does modifying an object, for example deleting an attribute or similar, in JS cause it to change the “actual” object?
The master object is returned as a string (workaround to pass a JSON from one place to the next) from the JS/Nanoflow, and is used as an argument for another JS, so surely Mendix cant do anything odd with that info.
If this interests someone, feel free to chime in. Otherwise I’d just like to say that the issue has been resolved. When I get the time Ill look into this further to understand how Mendix works.
If you notice something Im doing incorrectly or in a sub-optimal manner, please let me know. Anything that can improve my Mendix skills is highly appreciated.
Thanks!