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:
{
"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:
{
"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:
{
"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(...):
{
"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
- Open the PMD page in your Workday Extend tenant as a user with no existing attestation record and confirm that all
radioGroupoptions display unselected when"enabled": true. - Test a record where a boolean WQL field is
falseand verify that the"NO"radio option is selected rather than blank. - On an edit page with a 3-option
radioGroup, test saving and reloading each of the three options to verifyselectedValuesmaps the saved value back to the exact optionid. - Select the restricted dropdown value or exclusive
instanceListitem and confirm thatsetValues()andsetValue()restrict the selectable items and restore them when deselected.