# Global predefined hardcoded attributes

**URL:** <https://discourse.openondemand.org/t/global-predefined-hardcoded-attributes/4790>\
**Category:** Get Help\
**Created:** [March 9, 2026, 6:19pm UTC](https://discourse.openondemand.org/t/global-predefined-hardcoded-attributes/4790 "2026-03-09T18:19:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hansen-m](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hansen-m/32/2200_2.png) [@hansen-m](https://discourse.openondemand.org/u/hansen-m)\
**Post date:** [March 9, 2026, 6:19pm UTC](https://discourse.openondemand.org/t/global-predefined-hardcoded-attributes/4790/1 "2026-03-09T18:19:40Z")

</div>

I think this is unsupported but wanted to verify. OnDemand version: 4.1.4

As of 4.1 predefined form attributes are supposed to be [configurable](https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/form.html#global-batch-connect-form-items) as `global_bc_form_items`

This seems to work great with normally defined attributes but I’m getting errors when trying to use it with [hardcoded](https://osc.github.io/ood-documentation/latest/enable-desktops/modify-form-attributes.html#change-to-xfce-desktop) values. It appears to only attempt to handle it as an array rather than a string or integer value. In this case, `global_bc_vnc_idle` causes an error.

```yaml
global_bc_form_items:
  global_bc_vnc_idle: "0"
  global_bc_num_hours:
    label: "Number of hours"
    value: 4
    max: 336

```

```auto
dashboard/app/views/batch_connect/shared/_app_list_item.html.erb where line #1 raised:

undefined method `to_h' for an instance of String
Extracted source (around line #16):

      config = config.to_h.deep_merge(opts)

```

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [March 9, 2026, 6:23pm UTC](https://discourse.openondemand.org/t/global-predefined-hardcoded-attributes/4790/2 "2026-03-09T18:23:12Z")

</div>

Maybe it’s more like this? I can create a ticket upstream to check for a string/other scalar and cast it to the value.

```yaml
global_bc_form_items:
  global_bc_vnc_idle: 
    value: "0"
  global_bc_num_hours:
    label: "Number of hours"
    value: 4
    max: 336

```

---

<div class="post-metadata">

**Author:** ![hansen-m](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hansen-m/32/2200_2.png) [@hansen-m](https://discourse.openondemand.org/u/hansen-m)\
**Post date:** [March 9, 2026, 7:13pm UTC](https://discourse.openondemand.org/t/global-predefined-hardcoded-attributes/4790/3 "2026-03-09T19:13:13Z")

</div>

There’s no errors when setting the `value` attribute or any others that I tried but that option only sets the default placeholder value rather than hardcoding it and hiding it on the form.

It’s not a big deal to configure it per-app, but for most of my apps it will be the only attribute listed in the form.yml because globals are working great for everything else.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [March 9, 2026, 7:18pm UTC](https://discourse.openondemand.org/t/global-predefined-hardcoded-attributes/4790/4 "2026-03-09T19:18:16Z")

</div>

Does adding `fixed: true` do anything?

```yaml
global_bc_form_items:
  global_bc_vnc_idle: 
    value: "0"
    fixed: true
  global_bc_num_hours:
    label: "Number of hours"
    value: 4
    max: 336

```

---

<div class="post-metadata">

**Author:** ![hansen-m](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hansen-m/32/2200_2.png) [@hansen-m](https://discourse.openondemand.org/u/hansen-m)\
**Post date:** [March 10, 2026, 2:58pm UTC](https://discourse.openondemand.org/t/global-predefined-hardcoded-attributes/4790/5 "2026-03-10T14:58:02Z")

</div>

> [@jeff.ohrstrom](#):
>
> ```auto
> global_bc_vnc_idle: 
> value: "0"
> fixed: true
> 
> ```

Yes, that seems to work! I didn’t realize ‘fixed’ also hid the form element but that makes sense. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [September 6, 2026, 2:58pm UTC](https://discourse.openondemand.org/t/global-predefined-hardcoded-attributes/4790/6 "2026-09-06T14:58:21Z")

</div>

Closed on September 6, 2026, 2:58pm UTC

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