Model's JSON custom parameter works from the shapediver account page, but not from the embedded one


So, I’ve integrated the model into my custom web page and hooked all params with my controls and it works fine, but there is one parameter which is called JSON custom which controls the visuals of the models sub-elements (Like windows and doors of a building). I’ve received the example JSON for it and when I insert it into the shapediver’s admin side editor, it works, yet it doesn’t seem to work when I pass it via updateAsync method. Also, I’ve looked into the parameters note (in api.parameters.get()) and it says, that the property is currently inactive. Any way to enable it? The standalone JSON looks like this: { "openings": [ { "type":"dr", "width": 900, "height": 2000, "loc": [0,1400,600], "wall": "frontWall" }, ] }

I’ve tried to pass it in a regular way: ‘JSON custom’, value: ‘the actual json’ and in a standalone way, yet nothing happens. No validation errors returned. Just the message, that configurator failed to update. The page:

Hi @lomidzelf, please make sure you are sending the JSON as a string.

var openingsJSON =  { "openings": [ { "type":"dr", "width": 900, "height": 2000, "loc": [0,1400,600], "wall": "frontWall" } ] }

api.parameters.updateAsync({name:"JSON custom", value:JSON.stringify(openingsJSON)});

I have already tested this in your website and it works.

I hope this helps.

@edsahergom Awesome! Missed the stringify part, thought it would work same as other params. Thanks a lot, you really helped me!

1 Like