Hello, I am trying to implement a custompickerField, but I still don't understand very well how the suggestFunction and selectedLabels work since I have my DP_addressSugestion rule that receives the address and through the Google Maps API it already returns the filtering. Here is my suggestFunction.
a!localVariables( local!addressSugestion: rule!DP_AddressGoogleMaps( address: ri!address, latitud: -9.5, longitud: -75 ), if( local!addressSugestion.success, a!localVariables( local!labels: a!forEach( items: local!addressSugestion.result.places, expression: index(fv!item, "description", null) ), local!values: a!forEach( items: local!addressSugestion.result.places, expression: index(fv!item, "description", null) ), a!dataSubset( data: local!labels, identifiers: local!values, ) ), a!dataSubset( data: {}, identifiers: {}, totalCount: 0 ) ) )
Please help me to understand or some advices to work it
Discussion posts and replies are publicly visible
Are you getting any error? Also can you share the picker field code as well?
a!pickerFieldCustom( label: "pon tu direccion papi", value: local!origin, saveInto: local!origin, suggestFunction: rule!DP_addressSugestion( address: local!origin ), selectedLabels: local!origin, maxSelections: 1 ),
Here is my pickerField code
and in the image there is the result of my suggestionFunction
Your suggest function configuration looks off. Can you refer to a example pattern here and make similar changes. Then share if you get stuck somehwhere!