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
19 replies
Subscribers
7 subscribers
Views
7214 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
How do I save multiple selections in a checkboxField? I tried displaying the cho
judym598
Certified Senior Developer
over 8 years ago
How do I save multiple selections in a checkboxField? I tried displaying the choiceValues using a rule (e.g., rule!psh_getAllFruits) that pulled data from a cdt (PSH_Fruits). The CDT is associated with a table (pshfruits) that has 2 columns: id (auto-generated integer) and fruitType (text). I wanted to store the selected id(s) in a field in another CDT (specifically newList_cdt.fruitType). I originally had 'fruit' as an integer. When that didn't work, I decided to change my approach to displaying the choiceValues using a constant (cons!PSH_FRUITS) and using a checkboxFieldByIndex; couldn't get that to work, so I went with the following and changed the data type of the column in the table (and CDT for this item) to 'text'. It works as long as I only select one item. (I actually have 8 choices so I'd really prefer to pull the choiceValues from a CDT - lookup table). I cannot get it to save or display multiple selections. At one point...
OriginalPostID-192632
OriginalPostID-192632
Discussion posts and replies are publicly visible
Parents
0
narasimhaadityac
A Score Level 2
over 8 years ago
@judy, in this case generally what we would do is, save the array directly in the database as VARCHAR (uniformed string) and while display use the split function to display them (i mean convert to array).
a!checkboxField(
label: "What type of fruit?",
labelPosition: "ABOVE",
choicelabels: {"Bananas", "Apples", "Pears", "Grapes" },
choiceValues: {"B", "A", "P", "G"},
value: if(rule!APN_isEmpty(ri!fruitType),null, split(ri!fruitType,"; ")),
saveInto: ri!fruitType,
instructions:touniformstring(ri!fruitType),
refreshAfter: "UNFOCUS",
readOnly: false,
validation: {}
),
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
narasimhaadityac
A Score Level 2
over 8 years ago
@judy, in this case generally what we would do is, save the array directly in the database as VARCHAR (uniformed string) and while display use the split function to display them (i mean convert to array).
a!checkboxField(
label: "What type of fruit?",
labelPosition: "ABOVE",
choicelabels: {"Bananas", "Apples", "Pears", "Grapes" },
choiceValues: {"B", "A", "P", "G"},
value: if(rule!APN_isEmpty(ri!fruitType),null, split(ri!fruitType,"; ")),
saveInto: ri!fruitType,
instructions:touniformstring(ri!fruitType),
refreshAfter: "UNFOCUS",
readOnly: false,
validation: {}
),
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data