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
6 replies
Subscribers
7 subscribers
Views
2836 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hello, I am trying to create a pickerFieldCustom. I was able to make
issamd
over 10 years ago
Hello,
I am trying to create a pickerFieldCustom. I was able to make one that works when selecting a single result, but what is the best practice or implementation of selecting multiple results?
Thanks....
OriginalPostID-114655
OriginalPostID-114655
Discussion posts and replies are publicly visible
0
evan.rust
Appian Employee
over 10 years ago
In general: If you are following the SAIL recipe for custom pickers (
forum.appian.com/.../SAIL_Recipes
, notice that the apply() function is used over the rule!ucArrayPickerGetLabelForIdentifier rule in the selectedLabels parameter.
If you are having problems with your code, attach it to your post so others may assist you.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
issamd
over 10 years ago
If I want to avoid sending it to a rule, how can I do that? This is what I have:
selectedLabels: if(
or(
rule!APN_isBlank(
ri!value
),
count(
ri!value
) = 0
),
null,
apply(
index(
_,
rule!Q_getEmployeeForPickerByID(
ri!value
).Name_Email_Division,
rule!Q_getEmployeeForPickerByID(
ri!value
).UserID,
ri!value
)
),
value: ri!value,
saveInto: {
ri!saveValueInto
}
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
issamd
over 10 years ago
ri!value is what's passed in to my expression. Name_Email_Division is the label that contains the UserID.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
issamd
over 10 years ago
I created the rule and used this code. Now when I test the picker it leaves no label.
selectedLabels: if(
or(
rule!APN_isBlank(
ri!value
),
count(
ri!value
) = 0
),
null,
apply(rule!RULE_multipleEmployeeLabelForPicker(identifier: _, labels: rule!Q_getEmployeeForPickerByID(
ri!value
).Name_Email_Division, identifiers: rule!Q_getEmployeeForPickerByID(
ri!value
).UserID), ri!value
)
),
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
issamd
over 10 years ago
Ignore all the previous code. What I have now is pasted below. It will select one item but then it returns an error related to selectedLabel and value not being the same length:
= a!pickerFieldCustom(
label: ri!label,
instructions: ri!instructions,
required: ri!required,
requiredMessage: ri!requiredMessage,
readOnly: ri!readOnly,
disabled: ri!disabled,
maxSelections: if(
isnull(
ri!maxSelections
),
1,
ri!maxSelections
),
suggestFunction: rule!RULE_getEmployeeForPicker(
_,
if(
rule!APN_isBlank(
ri!numResultsReturned
),
20,
ri!numResultsReturned
)
),
selectedLabels: if(
rule!APN_isBlank(
ri!value
),
null,
apply(rule!RULE_multipleEmployeeLabelForPicker(identifier: _, labels: rule!Q_getEmployeeForPickerByID(
ri!value
).Name_Email_Division, identifiers: rule!Q_getEmployeeForPickerByID(
ri!value
).UserID), ri!value
)
),
value: ri!value,
saveInto: {ri!value,
ri!saveValueInto
},
refreshAfter: "KEYPRESS"
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
issamd
over 10 years ago
For anyone of concern I've figured out my issue. It had to do with my query rule not accepting multiples. It works now, thank you.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel