I am trying to implement a record picker component within a form layout. For some reason is not working the way it should be. After implementing the expression code below the search results appears to be "No results found" when I tried to search for something using the component. I have created a constant (cons!ERP_PROVIDER_RECORD) that points to the record type and a local variable to hold the selected records. What I need to do is to find a way to fetch a list of providers (which are already stored in the backend) so the user can pick them to complete the form.
Here is the expression code:
a!pickerFieldRecords( label: "Proveedores Seleccionados", labelPosition: "ABOVE", placeholder: "Escriba para seleccionar proveedores", recordType: cons!ERP_PROVIDER_RECORD, value: local!storedRecord, saveInto: local!storedRecord, validations: {} )
Please help to fix this issue.
Discussion posts and replies are publicly visible
One of the most common sources for a misbehaving record picker that I've seen is when the Record Title is missing, which defeats the type-ahead as there's no record title to display inside the picker.
It makes sense. How do I set up the Record Title?
Over in the Record Type, find the Record Title section, which displays an expressionable field. In that field, type rf! to get a list of available fields to use as the Record's title.
Got it! That fixed my issue. Thanks a lot Jim!
Glad that worked!
Hi Jim, I still having a small issue with the record picker... for some reason when I try to use a!save() to store the selected records on a rule input field it appears to be empty [] even though I have some records selected.
Do you have an idea of why this is happening?
Here is how my code looks like right now:
a!pickerFieldRecords( label: "Proveedores Seleccionados", labelPosition: "ABOVE", placeholder: "Escriba para seleccionar proveedores", recordType: cons!ERP_PROVIDER_RECORD, filters: a!queryFilter( field: "category", operator: "=", value: ri!ERP_Purchase_Request.category ), value: local!storedRecord, saveInto: local!storedRecord, required: true, validations: {} )
And this code I have when the user click on submit in the form:
saveInto: { a!save(ri!ERP_Purchase_Request.providers, local!storedRecord) },
My CDT:
The output when the user click on submit:
Hi - it looks like all you are able to save /set the value to is the Record Identifier(s). So your 'providers' attribute should be an array of Integer (assuming you're using an Integer as the Record Identifier and assuming you want to be able to pick multiple records).
Also: no need to save to a local!variable and then transfer to the 'providers' attribute when submitting the form. You can save directly to the rule input.
P.S. If you want to set the value of 'providers' as instances of the CDT that define the Record Type, you could create a Query Entity rule that takes as its input an array of Integer (representing the Record Identifiers) and retrieves the set of CDTs for those Identifiers e.g. something like...
saveInto: { a!save(ri!ERP_Purchase_Request.providers, rule!XXX_QE_getProvidersById(ProviderIds: local!storedRecord))},
Awesome! that works!
You're welcome!
Hi Jim,
Hi have the same issue (no data retrieved in the RecordPicker)... but when entering rf! in the Title field I don't have any available fields displayed.Could you give me an example of what you enter in this Record Title field expression please ?
If you're on a newer version of Appian, you need to use rv! instead of rf! to find the corresponding fields. See the Records Tutorial for an example of how to set up the title.