I added a User Picker to my Interface.
I have defined "Selected Users" as ri!selectedUsers (which is an array of type User)
I have defined "Save Into" as ri!selectedUsers
When I select user, the selection is not saved in the component. I have seen some advice regarding a!save, and using load and local variables, but I am missing something and can't seem to find it explicitly explained in videos or the documentation.
Any suggestions?
Thanks,
Rob
Discussion posts and replies are publicly visible
That sounds great... I am really close to getting this working. One problem when I update the interface -- to do with arrays I believe.
I've changed
"Save Selection To" to "ri!flight.firstOfficer"
and
"Selected Users" to ??? (I tried { touser(ri!flight.firstOfficer) } but that doesn't seem to work. I've tried "ri!flight.firstOfficer" but it has an issue with the type.
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!pickerFieldUsers [line 83]: A user picker component [label=“First Officer”] has an invalid value for “value”. All users must be valid and visible to the viewer.
is ri!flight an array or single? is ".firstOfficer" an array within the CDT or single?
they are both single. The page manages one flight and it has one first officer(co pilot)
As far as I can tell, then, it should work for you to set both the value and the saveInto parameters to simply point to "ri!flight.firstOfficer". Note that if some other data has become saved into it in the mean time, you might need to click "Test" again and reload a fresh copy of the interface and data to avoid errors.