Hi,
I am using below code in my interface where I am using pickerFieldCustom. Also, I am sharing my expression rule.
The issue which I am facing: After search with a certain text, I am able to get the result into the picker control, but it is disappearing upon the selection.
a!localVariables( local!pickedName, { a!pickerFieldCustom( label: "Name", maxSelections: 1, suggestFunction: rule!TestExpression(search: _), selectedLabels: local!pickedName, value: local!pickedName, saveInto: a!save(local!pickedName, union(save!value, save!value)) ) })
------------------
a!localVariables( local!data: a!queryEntity( entity: cons!Employee, query: a!query( logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "name", operator: "includes", value: ri!search ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo(startIndex: 1, batchSize: - 1) ), fetchTotalCount: false ).data, a!dataSubset(data: index(local!data, "name")))
Discussion posts and replies are publicly visible
a!localVariables( local!pickedName, { a!pickerFieldCustom( label: "Name", maxSelections: 1, suggestFunction: rule!TestExpression(search: _), selectedLabels: if(isnull(local!pickedName), {}, index(local!pickedName, "label", {})), value: local!pickedName, saveInto: a!save(local!pickedName, fv!selection) ) })
Below is a template assuming you're querying an entity for names.
a!localVariables( local!data: a!queryEntity( entity: cons!Employee, query: a!query( logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "name", operator: "includes", value: ri!search ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 10) ), fetchTotalCount: false ).data, map( a!forEach( items: local!data, expression: { id: fv!item.id, label: fv!item.name } ) ))
This might be because your final datasubset does not define the identifiers which the picker field requires.
Hi swapnar6405,
As Stefan explained, your final data subset does not define the identifiers which the picker field requires. and also after defining the Identifier as per your code, it will showcase the selected identifier in the picker field, you need to get the name based on the selected identifier. you can achieve it with the help of the index and the whercontain functionsthis is an SS of a picker field.
you can also go through this Documentation:-docs.appian.com/.../recipe-configure-an-array-picker-with-a-show-all-option.html
Thank you