Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
8 subscribers
Views
5463 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
How to I limit a checkbox field to one choice? I am using a checkbox field to ca
judym598
Certified Senior Developer
over 9 years ago
How to I limit a checkbox field to one choice? I am using a checkbox field to capture a 'Y' or 'N' value. This works just fine unless the user checks both boxes. I tried a couple validation rules on the field but none have worked so far. Any suggestions?
a!checkboxField(
label: "Certification Required?",
labelPosition: "ABOVE",
choicelabels: {
"Yes",
"No"
},
choiceValues: {
"Y",
"N"
},
value: ri!newAgreement_cdt.certRequired,
saveInto: ri!selectedAgreement_cdt.certRequire
),
OriginalPostID-191699
OriginalPostID-191699
Discussion posts and replies are publicly visible
0
aviroop
over 9 years ago
Try to use Radio button a!radioButtonField() when the choice is Yes or No.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tyler Criste
Appian Employee
over 9 years ago
Is it important that it be a checkboxfield? I typically use a radio button for yes/no fields.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
judym598
Certified Senior Developer
over 9 years ago
I like the look of the checkbox and I thought I could figure out a way to use a validation rule to check for multiple selections, but maybe it's not worth the effort - using a radio button may be easier. Thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Luke Schurman
Appian Employee
over 9 years ago
load(
local!checkboxValue,
local!checkboxSave,
a!dashboardLayout(
firstColumnContents: {
a!checkboxField(
label: "Certification Required?",
labelPosition: "ABOVE",
choicelabels: {
"Yes",
"No"
},
choiceValues: {
"Y",
"N"
},
value: local!checkboxValue,
saveInto: {
a!save(target: local!checkboxValue,
value: if(and(not(rule!APN_isBlank(save!value)), length(save!value)=2),
local!checkboxValue, save!value
)),
a!save(local!checkboxSave,
local!checkboxValue
)
}
),
a!textField(
label: "Display value: user will have to click away to see second selection disappear",
value: local!checkboxValue,
readOnly: true
),
a!textField(
label: "Saved Value",
value: local!checkboxSave,
readOnly: true
)
})
)
this may be useful
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
judym598
Certified Senior Developer
over 9 years ago
Luke - I went with the radio button but I plan on checking out what you suggested. Thanks for the help!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel