Skip to content
KiweelyKiweelyKiweely

Fixing radioGroup Options Disappearing When selectedValues Is Empty and Disabling Specific Options in Workday Extend PMD

In Workday Extend PMD, setting enabled to false on a radioGroup when selectedValues is null or [] hides every option. Learn how to keep unselected radio options visible, bind 3+ option radio groups on edit pages, and filter radioGroup or multi-select instanceList choices with setValues().

  • Checked against Workday on
  • Applies to Workday Extend
  • 3 min read
  • Published
  • By Kiweely
On this page

Why a radioGroup Hides All instanceList Options When selectedValues Is null or []

When a Workday Extend PMD page loads prior attestation or profile data from a WQL query and no record exists yet, selectedValues on a radioGroup evaluates to null or an empty list [] (list:emptyList()). If the radioGroup also has "enabled": false (read-only mode), Workday Extend completely hides all radio options, rendering only the widget label with blank space underneath.

This happens because a read-only ("enabled": false) list widget in Workday’s presentation layer only renders the currently selected entries; when selectedValues is [] or null, there is no selected entry to display. By contrast, when "enabled": true, setting "selectedValues": "<% list:emptyList() %>" renders all instanceList radio buttons unselected so the user can make a choice.

Avoiding the empty(false) Boolean Trap on selectedValues

A second issue arises when binding selectedValues to a boolean field returned by WQL (such as employeeTobaccoFree). In PMD scripting, empty(false) evaluates to true! Writing empty(row.employeeTobaccoFree) ? [] : ... treats false as empty and returns [] instead of selecting the "NO" radio button.

Always check == null explicitly before testing boolean values, and ensure "enabled": true whenever the user needs to see unselected radio buttons:

json
{
  "type": "radioGroup",
  "id": "tobaccoAttestationRadio",
  "label": "Certification for Employee",
  "enabled": true,
  "hideDisplayOption": true,
  "instanceList": [
    {
      "id": "YES",
      "descriptor": "Tobacco-Free: I have not used tobacco products within the past 30 days."
    },
    {
      "id": "NO",
      "descriptor": "Tobacco-User: I have used tobacco products within the past 30 days."
    }
  ],
  "selectedValues": "<%
    empty(workerAttestation.data)
      ? list:emptyList()
      : workerAttestation.data[0].employeeTobaccoFree == null
        ? list:emptyList()
        : workerAttestation.data[0].employeeTobaccoFree == true
          ? list:toList('YES')
          : list:toList('NO')
  %>"
}

Pre-Selecting a radioGroup with Three or More Options on an Edit Page

On an edit page, selectedValues on a radioGroup must always evaluate to a 1-element list containing the exact id string from instanceList (or [] when no selection exists). Returning a bare string ('Research') instead of a list (['Research']), or comparing against the option’s id when the inbound endpoint actually returns the descriptor text ('Administrative Service' vs 'AdminService'), causes the wrong radio button—or none—to be selected.

When mapping an inbound field across three or more options, return [] when the field is empty and wrap the nested ternary inside [...] so it always produces a 1-element list matching the option id:

json
{
  "type": "radioGroup",
  "id": "activityCategoryRadio",
  "label": "Activity Category",
  "hideDisplayOption": true,
  "instanceList": [
    {
      "id": "Research",
      "descriptor": "Research"
    },
    {
      "id": "AdminService",
      "descriptor": "Administrative Service"
    },
    {
      "id": "NonAdminService",
      "descriptor": "Non-Administrative Service"
    }
  ],
  "selectedValues": "<%
    empty(getNIA.activityCategory)
      ? []
      : [
          getNIA.activityCategory == 'Research'
            ? 'Research'
            : getNIA.activityCategory == 'Administrative Service'
              ? 'AdminService'
              : getNIA.activityCategory == 'Non-Administrative Service'
                ? 'NonAdminService'
                : ''
        ]
  %>"
}

Disabling Specific Options in a radioGroup or Multi-Select instanceList via setValues()

Neither radioGroup nor instanceList supports an enabled attribute on individual list items; calling widget.setEnabled(false) disables the entire control. When business rules require disabling one option based on another dropdown or when selecting an exclusive option (such as "None of the above" in a multi-select instanceList), dynamically filter the available choices using setValues(List dataSource) and update the active selection using setValue(List ids).

Filtering radioGroup Options from a Dropdown onChange

When selecting 'List2' in a dropdown should prevent the user from choosing 'yes' in a radioGroup, call yesNoRadio.setValues(...) and yesNoRadio.setValue(['no']) inside the dropdown’s onChange script:

json
{
  "type": "dropdown",
  "id": "listSelection",
  "label": "Select Category",
  "instanceList": [
    { "id": "List1", "descriptor": "Standard Category" },
    { "id": "List2", "descriptor": "Restricted Category" }
  ],
  "onChange": "<%
    if (!empty(self.value)) {
      if (self.value[0] == 'List1') {
        yesNoRadio.setValues([
          { 'id': 'yes', 'descriptor': 'Yes' },
          { 'id': 'no', 'descriptor': 'No' }
        ]);
      } else if (self.value[0] == 'List2') {
        yesNoRadio.setValues([
          { 'id': 'no', 'descriptor': 'No' }
        ]);
        yesNoRadio.setValue(['no']);
      }
    }
  %>"
},
{
  "type": "radioGroup",
  "id": "yesNoRadio",
  "label": "Include Allowance?",
  "hideDisplayOption": true,
  "instanceList": [
    { "id": "yes", "descriptor": "Yes" },
    { "id": "no", "descriptor": "No" }
  ]
}

Enforcing an Exclusive Option in a Multi-Select instanceList

Similarly, if a multiSelect: true instanceList has three options where 'OPT3' is mutually exclusive with 'OPT1' and 'OPT2', store the complete option list in pageVariables.allOptions during onLoad and use onChange to narrow or restore self.setValues(...):

json
{
  "type": "instanceList",
  "id": "exclusiveMultiList",
  "label": "Select Applicable Programs",
  "multiSelect": true,
  "values": "<% pageVariables.allOptions %>",
  "selectedValues": "<% [] %>",
  "onChange": "<%
    var exclusiveId = 'OPT3';
    var picked = self.value ?? [];
    var hasExclusive = !empty picked.find(selected => { selected == exclusiveId });
    if (hasExclusive) {
      var exclusiveOpt = pageVariables.allOptions.find(opt => { opt.id == exclusiveId });
      self.setValues([exclusiveOpt]);
      self.setValue([exclusiveId]);
    } else {
      self.setValues(pageVariables.allOptions);
    }
  %>"
}

When the user selects 'OPT3', self.setValues([exclusiveOpt]) removes 'OPT1' and 'OPT2' from the selectable list and self.setValue(['OPT3']) clears any prior selections. When the user removes 'OPT3' chip from the input box, self.setValues(pageVariables.allOptions) immediately restores all three options.

How to Verify in the Tenant

  1. Open the PMD page in your Workday Extend tenant as a user with no existing attestation record and confirm that all radioGroup options display unselected when "enabled": true.
  2. Test a record where a boolean WQL field is false and verify that the "NO" radio option is selected rather than blank.
  3. On an edit page with a 3-option radioGroup, test saving and reloading each of the three options to verify selectedValues maps the saved value back to the exact option id.
  4. Select the restricted dropdown value or exclusive instanceList item and confirm that setValues() and setValue() restrict the selectable items and restore them when deselected.

Sources checked

Related guides

All guides

Let Workday check the work.

Kiweely writes WQL and builds orchestrations in your own tenant, and Workday, not Kiweely, says whether they passed.

Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.

We’ll email you once to confirm. Unsubscribe in one click from any issue.