Setting initial value of a parameter when using an object as a value

I’m trying to set the initial value of a parameter to the label of an object option, but I keep getting [object] [object] in the UI input. Based on the documentation, it shows the label value as the initial value, but it doesn’t seem to work for me. Does anybody have any recommendations or fixes?

Code and screen cap below:
“phbold”: {
“label”: “Bold”,
“type”: “choose”,
“initial”: “No”,
“options”: [
{
“value”: {
“phboldopen”: “”,
“phboldclose”: “

},
“label”: “Yes”
},
{
“value”: {
“phboldopen”: “”,
“phboldclose”: “”
},
“label”: “No”
}
]
},
Screenshot 2023-04-23 at 6.25.21 PM

Hello @dwomble,

Thanks for writing in!

Yes, it should be the label. Kindly check this out:

In your case, you may need this:

{
  "phbold": {
    "label": "Bold",
    "type": "choose",
    "initial": "No",
    "options": [
      {
        "value": {
          "phboldopen": "",
          "phboldclose": ""
        },
        "label": "Yes"
      },
      {
        "value": {
          "phboldopen": "",
          "phboldclose": ""
        },
        "label": "No"
      }
    ]
  }
}

Hope this helps.

Not really - I copied and pasted the example from the documentation and get the same results (note I’m running Cornerstone 7.2.2 and Pro 6.2.2). If you click on the back arrow - it does bring up the 2 options, but it defaults to the first one.

I see what you’re talking about and we’ll try to address this. For default values I don’t think it’s setup for objects as values even if it works when already selected. If you changed your initial value to an object as well you would get the same result with [object object]. We’ll make some changes by either having the initial value have the potential to point to the label, or a new id key in the options array. Thanks for bringing this up and have a great day.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.