How to build a Custom Picker to search on all columns of a CDT. Similar to the search box in a Record Type on Grid Data.

Scenario: Building a custom picker that retrieves records based on the keyword entered. the picker should search on all columns in a CDT and retrieve name of the assets that have a matching keyword in any of the it's columns.

Please advise how to search on all columns of CDT, Similar to the search box in a Record Type on Grid Data.

Currently, we are searching only on two columns ProjectName and Id, to reduce the payload which is limited to 1GB.

  

Search entity code and retrieve only 2 columns to prevent reaching payload limit 1GB.

a!queryEntity(
entity: cons!NSARequest_Entity_Cons,
query: a!query(
selection: {
a!querySelection(
columns: {
a!queryColumn(
field: "ProjectName",
visible: true
),
a!queryColumn(
field: "Id",
visible: true
)
}
)
},
pagingInfo: a!pagingInfo(1,-1,a!sortInfo(field: "ProjectName", ascending: true))
)
).data

 

Picker Code

 

a!pickerFieldCustom(
label: "",
instructions: "Type to select and retrieve an asset details. You can select a maximum of 20 assets.",
placeholder: "Type to select and retrieve an asset details. You can select a maximum of 20 assets.",
maxSelections: 20,
suggestFunction: rule!NSA_SearchFilterMatch_ExprRule(
filter: _,
labels: local!assetLabels,
identifiers: local!assetIds
),
selectedLabels: a!forEach(
items: ri!pickedAsset,
expression: index(
local!assetLabels,
wherecontains(
fv!item,
tointeger(
local!assetIds
)
)
)
),
value: ri!pickedAsset,
saveInto: ri!pickedAsset
),

 

Code used to match the keyword with above search results:

  Discussion posts and replies are publicly visible